https://github.com/gevorg/apache-crypt
Node.js module for Apache style password encryption using crypt(3).
https://github.com/gevorg/apache-crypt
crypt javascript unix-crypt
Last synced: 6 months ago
JSON representation
Node.js module for Apache style password encryption using crypt(3).
- Host: GitHub
- URL: https://github.com/gevorg/apache-crypt
- Owner: gevorg
- License: mit
- Created: 2013-12-28T12:11:59.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T10:32:43.000Z (over 1 year ago)
- Last Synced: 2024-12-08T19:23:35.003Z (about 1 year ago)
- Topics: crypt, javascript, unix-crypt
- Language: JavaScript
- Homepage:
- Size: 320 KB
- Stars: 9
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# apache-crypt
[Node.js](http://nodejs.org/) package for Apache style password encryption using crypt(3).
[](https://github.com/gevorg/apache-crypt/actions/workflows/build.yml)
## Installation
Via git (or downloaded tarball):
```bash
$ git clone git@github.com:gevorg/apache-crypt.git
```
Via [npm](http://npmjs.org/):
```bash
$ npm install apache-crypt
```
## Usage
```javascript
const crypt = require("apache-crypt");
// Encrypting password using auto-generated 2 char salt.
const encryptedPassword = crypt("mypass");
// Should print true.
console.log(crypt("mypass", encryptedPassword) == encryptedPassword);
// Should print false.
console.log(crypt("notmypass", encryptedPassword) == encryptedPassword);
```
## Running tests
It uses [mocha](https://mochajs.org/), so just run following command in package directory:
```bash
$ npm test
```
## License
The MIT License (MIT)