dat-key-as
Get a dat key as a string or buffer.
- valid string/buffer: Returns a dat key as a string/buffer
- invalid key: Throws error
- null: Returns null
Checks if keys are valid via dat-encoding. Uses dat-string-key and dat-buffer-key to get the key as the right type.
API
Get your key as a string or buffer. Throws error if the key is not valid.
var datKeyAs = datKeyAs // get a key as a stringdatKeyAs // get a key as a buffer datKeyAs // get a key as a stringdatKeyAs // get a key as a buffer
License
MIT