Reputation: 447
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?
Upvotes: 0
Views: 12073
Reputation: 447
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.
Upvotes: 3