dat-string-key

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i dat-string-key

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jhand