sha256
sha256 copied to clipboard
Deprecated
Hi
I am interested to carry this project further. I having using the module for more than a year now, I don't find a easy alternative for this library.
Hi @narayananramu why not use either Node.js crypto
or https://www.npmjs.com/package/create-hash?
@jprichardson because
sha256('sss')
is easier than
hash.update('synchronous write'); hash.digest();
update
is chainable method
createHash('sha256').update(Buffer).digest()
is valid code
@fanatid also
sha256.x2('string');
is easier than
createHash('sha256').update(createHash('sha256').update('string').digest()).digest()
just write a one-line wrapper in your own code and call it a day, even safer because it's your own layer of abstraction now:
const hash = (payload: string): string => createHash('sha256').update(createHash('sha256').update('string').digest()).digest();