Initial commit

This commit is contained in:
2019-10-04 05:52:54 +02:00
commit 9a70f88a3e
4 changed files with 285 additions and 0 deletions

4
sha256.js Normal file
View File

@@ -0,0 +1,4 @@
async function sha256(message) {
const hashBuffer = await crypto.subtle.digest('SHA-256', new TextEncoder('utf-8').encode(message));
return Array.from(new Uint8Array(hashBuffer)).map(b => ('00' + b.toString(16)).slice(-2)).join('');
}