1.0.0 • Published 7 years ago

dat-string-key v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

dat-string-key Travis npm

Might return a Dat string key

  • valid string/buffer: Returns a dat key as a string
  • invalid key: Throws error
  • null: Returns null

Usage

var strKeyMaybe = require('dat-string-key')

var key = strKeyMaybe(new Buffer(process.argv[2], 'hex'))

try {
  console.log('maybe a key: key valid or null', strKeyMaybe(key))
} catch (e) {
  console.log('key not valid')
}

License

MIT