How to use the sha256 function from node-forge
Find comprehensive JavaScript node-forge.sha256 code examples handpicked from public code repositorys.
39 40 41 42 43 44 45 46 47 48
method, url, postdata, signingDate ) const digest = forge.sha256 .create() .update(sigData) .digest() .getBytes()
GitHub: head-js/vanilla.js
![head-js profile picture](/head-js.png?size=40)
2 3 4 5 6 7 8 9 10
/** * @param text [String] * @return hash [String] e.g. 8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918 */ module.exports = function sha256(text) { var md = forge.sha256.create(); md.update(text, 'utf8'); return md.digest().toHex(); };
GitHub: tearust/tea-js-sdk
![tearust profile picture](/tearust.png?size=40)
4 5 6 7 8 9 10 11 12 13
const F = { hash(data: any){ return js_sha256(data); }, sha256(data: any){ const tmp = forge.sha256.create(); tmp.update(data); return tmp.digest().toHex();
node-forge.pki is the most popular function in node-forge (10287 examples)