Refactoring work to support multi-tenancy and multiple storage, database backends (#598)
* Backend infrastructure * New backend configuration work * Factor out KV prefixing * Don't put assets in the manifest cache * Removed fancy authentication stuff * Documentation updates
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export async function hashSHA256(message: string): Promise<string> {
|
||||
// Transform the string into an ArrayBuffer
|
||||
const encoder = new TextEncoder();
|
||||
const data = encoder.encode(message);
|
||||
|
||||
// Generate the hash
|
||||
const hashBuffer = await window.crypto.subtle.digest("SHA-256", data);
|
||||
|
||||
// Transform the hash into a hex string
|
||||
return Array.from(new Uint8Array(hashBuffer)).map((b) =>
|
||||
b.toString(16).padStart(2, "0")
|
||||
).join("");
|
||||
}
|
||||
Reference in New Issue
Block a user