1.0.0 • Published 7 years ago
dat-string-key v1.0.0
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
1.0.0
7 years ago