Socket
Book a DemoInstallSign in
Socket

hash-ninja

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-ninja

Quick methods for creating hashes using the native Node crypto module.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

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`); // By default, uses SHA512 and 'hex' output.
const advancedHash = hasher(`some-value-to-hash`, `sha1`, `utf8`); // Specify a specific algorithm and 'hex' digest encoding.

const hexOutput = hasher.sha256(`some-value-to-hash`); // Quick helper methods for specific algorithms, defaults to 'hex' digest encoding.
const base64Output = hasher.md5(`some-value-to-hash`, `base64`); // Use any Node digest encoding.

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).

Keywords

hash

FAQs

Package last updated on 06 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts