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

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    1
  • 0.0.0
    2

Package Sidebar

Install

npm i unhash

Weekly Downloads

3

Version

0.1.0

License

Apache-2.0

Last publish

Collaborators

  • justmoon