dat-string-key
v1.0.0
Published
get a dat key as a string, maybe
Downloads
14
Readme
dat-string-key
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