Created
February 4, 2023 07:27
-
-
Save thexeromin/e000748346e086b59e5078a29443c01d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { SHA256 } from "crypto-js"; | |
const createHash = (str1, str2) => { | |
let arr1 = [str1, str2]; | |
const sortAlphaNum = (a, b) => a.localeCompare(b, "en", { numeric: true }); | |
const arrayOutput = arr1.sort(sortAlphaNum); | |
const hash = SHA256(arrayOutput.join("")).toString(); | |
return hash; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment