From a5e750eae752d9b900b3e4e6e3a026015a4e30a5 Mon Sep 17 00:00:00 2001 From: nicolas Date: Sun, 6 Jun 2021 01:29:27 +0200 Subject: [PATCH] Implemented SHA256 hash helper function --- lib/sha256.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lib/sha256.ts diff --git a/lib/sha256.ts b/lib/sha256.ts new file mode 100644 index 00000000..f06c173c --- /dev/null +++ b/lib/sha256.ts @@ -0,0 +1,10 @@ +const crypto = require('crypto'); + +function sha256(input: string): string { + return crypto + .createHash('sha256') + .update(input) + .digest("hex"); +} + +export default sha256; \ No newline at end of file