0.1.0 • Published 7 years ago

unhash v0.1.0

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
7 years ago

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