-
Notifications
You must be signed in to change notification settings - Fork 10
Buffer dWeb Keys
Jared Rice Sr edited this page Jun 28, 2018
·
1 revision
npm install @dwebs/buffer-key
yarn add @dwebs/buffer-key
This library might
return a dWeb key in a buffered format.
- valid string/buffer: Returns a dWeb key as a buffer
- invalid string: Throws error
- null: Returns null
Check out @dwebs/convert-key to get keys as strings or buffers!
var dWebBufferKey = require('@dwebs/buffer-key')
var dWebKey = dWebBufferKey(process.argv[2])
try {
console.log('maybe a key: key valid or null', dWebBufferKey(dWebKey))
} catch (e) {
console.log('key not valid')
}