
enigma-hash
Demystifying hashing, made simple and easy
Contents
Install
yarn add enigma-hash
OR
npm install enigma-hash
Usage
Require in the module
const hash =
Hash like below:
const hashValue = // hash(input, algorithm, code)
Hash with a key (Hmac) like below:
const hashValue = // hash(input, algorithm, code, key)
Parameter | Description | Type | Options | Default Value |
---|---|---|---|---|
Input |
Value you want to Hash | Any |
n/a |
" " |
Algorithm |
Algorithm you want to hash data with | String |
sha256 / sha512 |
sha256 |
Code |
Encoding you want hash to return with | String |
hex / latin1 / base64 |
hex |
Key |
Key used to encrypt data | String |
Any |
No key |
CLI Tool
Install with:
npm install -g enigma-hash
& simply run with the following:
enigma --alg sha256 --code hex --data <some string to hash>
Contribute
Contributions are welcome!
- Fork it.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Or open up a issue.
License
MIT