Created
June 5, 2023 06:21
-
-
Save cloverink/7add2f044ec260cb419c61d921d0d11c to your computer and use it in GitHub Desktop.
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') | |
const checksum = (str, algorithm = 'md5', encoding = 'hex') => { | |
return crypto | |
.createHash(algorithm) | |
.update(str, 'utf8') | |
.digest(encoding) | |
} | |
module.exports = { | |
checksum | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment