Created
September 16, 2022 17:57
-
-
Save mcpeblocker/b19c0ae7e5aced793fc888291d051f8f to your computer and use it in GitHub Desktop.
Generate SHA1 Hash for OpenBudget validation using phone and application id.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require("crypto"); | |
/* | |
t = { | |
phone: "+998 (99) 345-12-12", | |
application: "128222" | |
} | |
*/ | |
function generateKey(t) { | |
var e = "", | |
n = crypto.createHash("sha1"); | |
for (var o in t) e += "".concat(o, ":").concat(t[o]); | |
return ( | |
(e = "".concat(e, "_").concat("gxmo2RTwVMxCBOha22TusE8sItJdiyHj")), | |
n.update(e), | |
n.digest("hex") | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment