dollar-hash

0.0.0 • Public • Published

dollar-hash

Build Status License MIT

A module for creating hashes, which indicate the algorithm being used like "alg$hash". Install it with npm install dollar-hash.

It was inspired and can be used for the specification of the Open Badges verification.

var hash = require('dollar-hash')
 
var text = 'the text to hash'
var dollarhash = hash(text, 'mysalt', 'sha256')
 
hash.verify(dollarhash, text, 'mysalt', 'sha256')
// evaluates to true

Methods

hash(text[, salt, algorithm])

Creates a dollar hash of text, optionally with a specific salt and algorithm (defaults to sha256).

hash.verify(dollarhashed, text[, salt, algorithm])

Compares the hash of text with dollarhashed, optionally using a salt and a specific algorithm (defaults to sha256). Returns a boolean value.

hash.create / hash.hash

Aliases of hash.

Readme

Keywords

Package Sidebar

Install

npm i dollar-hash

Weekly Downloads

2

Version

0.0.0

License

MIT

Last publish

Collaborators

  • finnpauls