Generates either an MD5 or SHA1 hash. Use crypto-js.
Executed
Server-side
Details
var hash = require('hash');
Input can be either a string or buffer. The output is a string.
Method | Description |
---|---|
md5 | Generates an MD5 hash |
sha1 | Generates an SHA1 hash |
Example
function( params, credentials ) {
var hash = require('hash');
var result = hash.md5('whatever');
return result;
}
{
"jsonrpc": "2.0",
"id": 183,
"result": "008c5926ca861023c1d2a36653fd88e2"
}
Last modified on 10 March 2020