I need to hash string in angular 2+ with SHA512, but i couldn't find any library or function to do that. Do you know of any solution to that?
1 Answer
Ok, i found the solution. I installed this npm package
then I included this package into my service (you can include it in component or wherever you need it) like that
import * as sha512 from 'js-sha512';
and finally used it as it says in documentation like that:
sha512.sha512('Message to hash');
The library has to be used to get to the function provided by it.
1 Comment
KBeDev
Note you can use it with:
import { sha512 } from 'js-sha512'; And then, create your hash like this: sha512.create().update(<something_to_hash>).hex()
SHA256 != SHA512.