Last active
March 16, 2022 04:28
-
-
Save esctabcapslock/f3e7258241bb3658ad8355eed087df57 to your computer and use it in GitHub Desktop.
해싱 (node.js)
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 MD5 = (txt)=> crypto.createHash('md5').update(txt).digest('hex'); |
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 SHA256 = (txt)=> crypto.createHash('sha256').update(txt).digest('hex'); |
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 SHA512 = (txt)=>{ | |
//creating hash object | |
const hash = crypto.createHash('sha512'); | |
//passing the data to be hashed | |
const data = hash.update('bfg'+txt, 'utf-8'); | |
//Creating the hash in the required format | |
const gen_hash= data.digest('hex'); | |
//Printing the output on the console | |
return gen_hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment