From 400f6e410cd6a98af5fa3d09f79aa32aa5edacbb Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Sun, 25 Apr 2021 19:46:55 -0300 Subject: [PATCH] use jsSHA lib --- src/main/resources/web/index.html | 2 +- src/main/resources/web/js/util.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/resources/web/index.html b/src/main/resources/web/index.html index ce72735..3d9a946 100644 --- a/src/main/resources/web/index.html +++ b/src/main/resources/web/index.html @@ -24,7 +24,7 @@ - + diff --git a/src/main/resources/web/js/util.js b/src/main/resources/web/js/util.js index 1667141..3735c41 100644 --- a/src/main/resources/web/js/util.js +++ b/src/main/resources/web/js/util.js @@ -14,4 +14,10 @@ function icanhazip(cors) { .then(checkFetchSuccess("code")) .then(r => r.text()) .then(it => it.trim()); -} \ No newline at end of file +} + +function sha512(s) { + const shaObj = new jsSHA("SHA-512", "TEXT", { encoding: "UTF8" }); + shaObj.update(s); + return shaObj.getHash("HEX"); +}