Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/urbit/argon2-wasm
Based off https://github.com/antelle/argon2-browser
https://github.com/urbit/argon2-wasm
Last synced: about 2 months ago
JSON representation
Based off https://github.com/antelle/argon2-browser
- Host: GitHub
- URL: https://github.com/urbit/argon2-wasm
- Owner: urbit
- Created: 2018-07-25T14:28:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-31T18:17:54.000Z (over 5 years ago)
- Last Synced: 2024-10-31T18:14:17.669Z (about 2 months ago)
- Language: JavaScript
- Size: 2.2 MB
- Stars: 18
- Watchers: 28
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Argon2 WebAssembly
Argon2 (with Argon2u support) run as WebAssembly.
## Install
```
npm install --save argon2-wasm
```## Usage
```
import argon2 from 'argon2-wasm';
argon2.hash({pass: 'password', salt: 'somesalt', distPath: 'dist'}).then(console.log);
/* Logs:
{ hash:
Uint8Array [ ... ],
hashHex:
'f38afe1266d247cf1f6f836ffdbb0ab946c0a7edbcb4ba6e7324b32b9050441e',
encoded:
'$argon2d$v=19$m=1024,t=10,p=1$c29tZXNhbHQ$84r+EmbSR88fb4Nv/bsKuUbAp+28tLpucySzK5BQRB4' }
*/
```The input object has the following parameters and defaults:
```
{string} pass password string
{string} salt salt string
{float} time (1) the number of iterations
{float} mem (1024) used memory, in KiB
{float} hashLen (24) desired hash length
{float} parallelism (1) desired parallelism (will be computed in parallel only for PNaCl)
{number} type (argon2.types.Argon2d) hash type: argon2.ArgonType.Argon2d, .Argon2i, .Argon2id or .Argon2u
{string} distPath ('.') asm.js script location, without trailing slash
```## Building
Prerequisites:
- emscripten with WebAssembly support ([howto](http://webassembly.org/getting-started/developers-guide/))
- CMakeUse the provided build script:
```bash
./build.sh
```You can also use `npm run-script build`, which will call that directly.
## License
[MIT](https://opensource.org/licenses/MIT)