Skip to content

Instantly share code, notes, and snippets.

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