Skip to content

Instantly share code, notes, and snippets.

@cloverink
Created June 5, 2023 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloverink/7add2f044ec260cb419c61d921d0d11c to your computer and use it in GitHub Desktop.
Save cloverink/7add2f044ec260cb419c61d921d0d11c to your computer and use it in GitHub Desktop.
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