websocket快速操作工具
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.

42 lines
965 B

  1. # apache-crypt
  2. [Node.js](http://nodejs.org/) package for Apache style password encryption using crypt(3).
  3. [![build](https://github.com/gevorg/apache-crypt/workflows/build/badge.svg)](https://github.com/gevorg/apache-crypt/actions/workflows/build.yml)
  4. ## Installation
  5. Via git (or downloaded tarball):
  6. ```bash
  7. $ git clone git://github.com/gevorg/apache-crypt.git
  8. ```
  9. Via [npm](http://npmjs.org/):
  10. ```bash
  11. $ npm install apache-crypt
  12. ```
  13. ## Usage
  14. ```javascript
  15. const crypt = require("apache-crypt");
  16. // Encrypting password using auto-generated 2 char salt.
  17. const encryptedPassword = crypt("mypass");
  18. // Should print true.
  19. console.log(crypt("mypass", encryptedPassword) == encryptedPassword);
  20. // Should print false.
  21. console.log(crypt("notmypass", encryptedPassword) == encryptedPassword);
  22. ```
  23. ## Running tests
  24. It uses [mocha](https://mochajs.org/), so just run following command in package directory:
  25. ```bash
  26. $ npm test
  27. ```
  28. ## License
  29. The MIT License (MIT)