Cache the blobs generated by scripts

This commit is contained in:
theit8514
2021-12-12 19:39:53 -05:00
parent ed86577d6c
commit 8f77f720e6
9 changed files with 136 additions and 20 deletions
+12
View File
@@ -0,0 +1,12 @@
import { sha256 } from "js-sha256";
/**
* Computes a SHA-256 hash of a string synchronously
* @param message The input string
* @returns The SHA-256 hash in hex
*/
export function computeHash(message: string): string {
var hash = sha256.create();
hash.update(message);
return hash.hex();
}