Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bonniernews/unixcrypt-js
https://github.com/bonniernews/unixcrypt-js
Last synced: about 8 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/bonniernews/unixcrypt-js
- Owner: BonnierNews
- License: apache-2.0
- Created: 2019-11-08T19:59:30.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-10T08:23:35.000Z (10 months ago)
- Last Synced: 2024-11-08T13:21:46.777Z (10 days ago)
- Language: JavaScript
- Size: 233 KB
- Stars: 0
- Watchers: 43
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unixcrypt for Node.js - JS version
[![Build Status](https://travis-ci.com/BonnierNews/unixcrypt-js.svg?branch=master)](https://travis-ci.com/BonnierNews/unixcrypt-js)A Node.js module for encrypting and verifying passwords according to the SHA-256 and SHA-512 Crypt standard:
https://www.akkadia.org/drepper/SHA-crypt.txt . Based on the TypeScript package [unixcrypt](https://github.com/markusberg/unixcrypt).## Dependencies
This package has no external dependencies. It uses the cryptographic facilities built into Node.js.
For development there are dependencies on Chai and Mocha.
## Usage
### JavaScript
```javascript
var unixcrypt = require("unixcrypt")const plaintextPassword = "password"
const pwhash = unixcrypt.encrypt(plaintextPassword)// verify password with generated hash
console.log(unixcrypt.verify(plaintextPassword, pwHash))
// true
```
## TestThe tests are written with [Chai](http://www.chaijs.com/), and [Mocha](https://mochajs.org/).
```sh
$ yarn test
```