unhash

0.1.0 • Public • Published

What this module does

This module exports a function which accepts a SHA-256 hash as a hex-, base64- or base64url-encoded string and returns a promise for a Buffer. If unhash can find the source for the hash, it will fulfill the promise with the preimage, otherwise it will reject the promise.

const unhash = require('unhash')
 
unhash('UNhY4JhezH9gQYqvDMWrWH9CwlcKiECVqejMrND2VFw')
  .then(
    preimage => console.log(preimage.toString('utf8')),
    err => console.error(err)
  )

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.04latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.04
0.0.02

Package Sidebar

Install

npm i unhash

Weekly Downloads

5

Version

0.1.0

License

Apache-2.0

Last publish

Collaborators

  • justmoon