You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.8 KiB

4 years ago
  1. # minimalistic-crypto-utils
  2. [![Build Status](https://secure.travis-ci.org/indutny/minimalistic-crypto-utils.svg)](http://travis-ci.org/indutny/minimalistic-crypto-utils)
  3. [![NPM version](https://badge.fury.io/js/minimalistic-crypto-utils.svg)](http://badge.fury.io/js/minimalistic-crypto-utils)
  4. Very minimal utils that are required in order to write reasonable JS-only
  5. crypto module.
  6. ## Usage
  7. ```js
  8. const utils = require('minimalistic-crypto-utils');
  9. utils.toArray('abcd', 'hex');
  10. utils.encode([ 1, 2, 3, 4 ], 'hex');
  11. utils.toHex([ 1, 2, 3, 4 ]);
  12. ```
  13. #### LICENSE
  14. This software is licensed under the MIT License.
  15. Copyright Fedor Indutny, 2017.
  16. Permission is hereby granted, free of charge, to any person obtaining a
  17. copy of this software and associated documentation files (the
  18. "Software"), to deal in the Software without restriction, including
  19. without limitation the rights to use, copy, modify, merge, publish,
  20. distribute, sublicense, and/or sell copies of the Software, and to permit
  21. persons to whom the Software is furnished to do so, subject to the
  22. following conditions:
  23. The above copyright notice and this permission notice shall be included
  24. in all copies or substantial portions of the Software.
  25. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  26. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  27. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  28. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  29. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  30. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  31. USE OR OTHER DEALINGS IN THE SOFTWARE.
  32. [0]: http://tools.ietf.org/html/rfc6979
  33. [1]: https://github.com/indutny/bn.js
  34. [2]: https://github.com/indutny/hash.js
  35. [3]: https://github.com/bitchan/eccrypto
  36. [4]: https://github.com/wanderer/secp256k1-node