Skip to content

Instantly share code, notes, and snippets.

@takahashi-h5
Created October 22, 2020 08:53
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 takahashi-h5/24b4fa776c9865b0130bb6368be4cc58 to your computer and use it in GitHub Desktop.
Save takahashi-h5/24b4fa776c9865b0130bb6368be4cc58 to your computer and use it in GitHub Desktop.
const crypto = require('crypto')
const str = 'xxx'
const hashHex = crypto.createHash('sha256').update(str, 'utf8').digest('hex')
console.log(hashHex) // cd2eb0837c9b4c962c22d2ff8b5441b7b45805887f051d39bf133b583baf6860
// 64桁
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment