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
936 B

  1. # apache-md5
  2. [Node.js](http://nodejs.org/) package for Apache style password encryption using md5.
  3. [![build](https://github.com/gevorg/apache-md5/workflows/build/badge.svg)](https://github.com/gevorg/apache-md5/actions/workflows/build.yml)
  4. ## Installation
  5. Via git (or downloaded tarball):
  6. ```bash
  7. $ git clone git://github.com/gevorg/apache-md5.git
  8. ```
  9. Via [npm](http://npmjs.org/):
  10. ```bash
  11. $ npm install apache-md5
  12. ```
  13. ## Usage
  14. ```javascript
  15. const md5 = require("apache-md5");
  16. // Encrypting password using apache's md5 algorithm.
  17. const encryptedPassword = md5("mypass");
  18. // Should print true.
  19. console.log(md5("mypass", encryptedPassword) == encryptedPassword);
  20. // Should print false.
  21. console.log(md5("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)