Constructor
new SeaSalt_Hashing(stringopt, hashopt, formatopt)
Parameters
string:string
(optional)
hash:string
(optional)
format:string
(optional)
String to hash
Hashing algorithm to use
Output format of the hash data (hex, binary, base64)
Source: seasalt.js, line 229
Methods
sha256(string, formatopt):binary|string
Parameters
string:string
format:string
(optional)
String to hash
Output format of the hash data (hex, binary, base64)
Returns
- Type
- :binary|string
Returns in the requested format.
Example
let hash = new SeaSalt_Hashing();
hash.sha256('testing')
// returns a string like: cf80cd8aed482d5d1527d7dc72fceff84e6326592848447d2dc0b0e87dfc9a90
Source: seasalt.js, line 286
sha512(string, formatopt):binary|string
Parameters
string:string
format:string
(optional)
String to hash
Output format of the hash data (hex, binary, base64)
Returns
- Type
- :binary|string
Returns in the requested format.
Example
let hash = new SeaSalt_Hashing();
hash.sha512('testing')
// returns a string like: 521b9ccefbcd14d179e7a1bb877752870a6d620938b28a66a107eac6e6805b9d0989f45b5730508041aa5e710847d439ea74cd312c9355f1f2dae08d40e41d50
Source: seasalt.js, line 308
toString():string
Returns the hash result in hex format.
Returns
- Type
- :string
Source: seasalt.js, line 269