happyuc-keyfile-recognizer
v1.0.0
Published
Checks for valid structure of happyuc webu-secret-storage/presale keyfiles
Downloads
16
Maintainers
Readme
happyuc-keyfile-recognizer
Checks for structural sanity (key-names and value-types) of json
-keyfiles.
Currently recognized keyfiles:
- Hucersale
- webu-secret-storage (v3)
- scrypt
- pbkdf2
Installation
npm install --save happyuc-keyfile-recognizer
Usage
var fs = require('fs');
var recognizer = require('happyuc-keyfile-recognizer');
fs.readFile('keyfile.json', (err, data) => {
var json = JSON.parse(data);
var result = recognizer(json);
/** result
* [ 'webu', 3 ] webu (v3) keyfile
* [ 'hucersale', undefined ] Hucersale keyfile
* null no valid keyfile
*/
}));
Development
To build and run the tests:
$ npm install
$ npm test
Contributions
Contributions welcome - see CONTRIBUTING.md
License
MIT - see LICENSE.md