Hash-Ninja
Quick methods for creating hashes using the native Node crypto module.
Quick Start
const hasher = require('hash-ninja');
const quickHash = hasher(`some-value-to-hash`);
const advancedHash = hasher(`some-value-to-hash`, `sha1`, `utf8`);
const hexOutput = hasher.sha256(`some-value-to-hash`);
const base64Output = hasher.md5(`some-value-to-hash`, `base64`);
Useful methods
hasher.sha512(payload[, digestEncoding]);
Output an SHA512 hash of the given payload, with optional digest encoding (defaults to 'hex').
hasher.sha256(payload[, digestEncoding]);
Output an SHA256 hash of the given payload, with optional digest encoding (defaults to 'hex').
hasher.sha1(payload[, digestEncoding]);
Output an SHA1 hash of the given payload, with optional digest encoding (defaults to 'hex').
hasher.md5(payload[, digestEncoding]);
Output an MD5 hash of the given payload, with optional digest encoding (defaults to 'hex').
Full API
hasher(payload[, algorithm[, digestEncoding]]);
Output a hash of the given payload, with the algorithm and digest encoding optionally specified (defaults to 'sha512' and 'hex' respectively).