diff --git a/frontend/src/components/FileTreeItem.vue b/frontend/src/components/FileTreeItem.vue
index fddce9364..db7a59d18 100644
--- a/frontend/src/components/FileTreeItem.vue
+++ b/frontend/src/components/FileTreeItem.vue
@@ -1,22 +1,20 @@
diff --git a/frontend/src/services/utils.ts b/frontend/src/services/utils.ts
index 6742d8e56..c9943b217 100644
--- a/frontend/src/services/utils.ts
+++ b/frontend/src/services/utils.ts
@@ -5,3 +5,20 @@ export function sleep(delay: number): Promise {
export function isString(s: any) {
return typeof s === "string" || s instanceof String;
}
+
+export function remap(
+ x: number,
+ fromMin: number,
+ fromMax: number,
+ toMin: number,
+ toMax: number
+): number {
+ return ((x - fromMin) * (toMax - toMin)) / (fromMax - fromMin) + toMin;
+}
+
+export async function sha1(message: string) {
+ const msgUint8 = new TextEncoder().encode(message);
+ const hashBuffer = await crypto.subtle.digest("SHA-1", msgUint8);
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
+ return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
+}