Comparing version 0.29.1 to 0.30.1
@@ -16,4 +16,4 @@ "use strict"; | ||
timeCost: 3, | ||
memoryCost: 1 << 12, | ||
parallelism: 1, | ||
memoryCost: 1 << 16, | ||
parallelism: 4, | ||
type: types.argon2id, | ||
@@ -20,0 +20,0 @@ version: 0x13, |
{ | ||
"name": "argon2", | ||
"version": "0.29.1", | ||
"version": "0.30.1", | ||
"description": "An Argon2 library for Node", | ||
@@ -49,3 +49,3 @@ "main": "argon2.js", | ||
"dependencies": { | ||
"@mapbox/node-pre-gyp": "^1.0.9", | ||
"@mapbox/node-pre-gyp": "^1.0.10", | ||
"@phc/format": "^1.0.0", | ||
@@ -55,8 +55,8 @@ "node-addon-api": "^5.0.0" | ||
"devDependencies": { | ||
"@types/node": "^18.7.11", | ||
"@types/node": "^18.8.5", | ||
"c8": "^7.12.0", | ||
"mocha": "^10.0.0", | ||
"node-gyp": "^9.0.0", | ||
"node-gyp": "^9.3.0", | ||
"prettier": "^2.7.1", | ||
"typescript": "^4.7.4" | ||
"typescript": "^4.8.4" | ||
}, | ||
@@ -66,4 +66,4 @@ "binary": { | ||
"module_path": "./lib/binding/napi-v{napi_build_version}", | ||
"host": "https://github.com/ranisalt/node-argon2/releases/download/", | ||
"remote_path": "v{version}", | ||
"host": "https://github.com", | ||
"remote_path": "./ranisalt/node-argon2/releases/download/v{version}", | ||
"package_name": "{module_name}-v{version}-napi-v{napi_build_version}-{platform}-{arch}-{libc}.tar.gz", | ||
@@ -70,0 +70,0 @@ "napi_versions": [ |
108
README.md
@@ -52,26 +52,6 @@ # node-argon2 | ||
A TypeScript type declaration file is published with this module. If you are | ||
using TypeScript >= 2.0.0 that means you do not need to install any additional | ||
typings in order to get access to the strongly typed interface. Simply use the | ||
library as mentioned above. This library uses Promises, so make sure you are | ||
targeting ES6+, including the `es2015.promise` lib in your build, or globally | ||
importing a Promise typings library. | ||
using TypeScript 2.0.0 or later, that means you do not need to install any | ||
additional typings in order to get access to the strongly typed interface. | ||
Simply use the library as mentioned above. | ||
Some example tsconfig.json compiler options: | ||
```json | ||
{ | ||
"compilerOptions": { | ||
"lib": ["es2015.promise"] | ||
} | ||
} | ||
or | ||
{ | ||
"compilerOptions": { | ||
"target": "es6" | ||
} | ||
} | ||
``` | ||
```ts | ||
@@ -83,35 +63,24 @@ import * as argon2 from "argon2"; | ||
### Differences from [node-argon2-ffi](https://github.com/cjlarose/argon2-ffi) | ||
The interface of both are very similar, notably, node-argon2-ffi splits the | ||
argon2i and argon2d function set, but this module also has the argon2id option, | ||
which node-argon2-ffi **does not support**. Also, while node-argon2-ffi | ||
suggests you promisify `crypto.randomBytes`, node-argon2 library does that | ||
internally. | ||
**node-argon2** is much lighter than **node-argon2-ffi**, at 184 KB for | ||
argon2@0.27.0 against 2.56 MB for argon2-ffi@1.2.0. Performance-wise, the | ||
libraries are equal. You can run the same benchmark suite if you are curious, | ||
but both can perform around 130 hashes/second on an Intel Core i5-4460 @ 3.2GHz | ||
with default options. | ||
This library is implemented natively, meaning it is an extension to the node | ||
engine. Thus, half of the code is C++ bindings, the other half is Javascript | ||
functions. node-argon2-ffi uses ffi, a mechanism to call functions from one | ||
language in another, and handles the type bindings (e.g. JS Number -> C++ int). | ||
## Prebuilt binaries | ||
**node-argon2** provides prebuilt binaries from `v0.26.0` onwards. They are | ||
built per release using GitHub Actions. | ||
built every release using GitHub Actions. | ||
The current prebuilt binaries are built (and tested) with the following matrix: | ||
1. Node 12.x, 14.x, 16.x | ||
2. Ubuntu 18.04, Alpine Linux, Windows Server 2019, macOS Catalina 10.15 | ||
The current prebuilt binaries are built and tested with the following systems: | ||
- Ubuntu 20.04 (x86-64; ARM64 from v0.28.2) | ||
- MacOS 11 (x86-64) | ||
- MacOS 12 (ARM64 from v0.29.0) | ||
- Windows Server 2019 (x86-64) | ||
- Alpine Linux 3.13 (x86-64 from v0.28.1; ARM64 from v0.28.2) | ||
- FreeBSD 13.1 (x86-64 from v0.29.1) | ||
If your platform is below the above requirements, you can follow the | ||
[Before Installing](#before-installing) section below to manually compile from | ||
source. It is also always recommended to build from source to ensure consistency | ||
of the compiled module. | ||
Binaries should also work for any version more recent than the ones listed | ||
above. For example, the binary for Ubuntu 20.04 also works on Ubuntu 22.04, or | ||
any other Linux system that ships a newer version of glibc; the binary for | ||
MacOS 11 also works on MacOS 12. If your platform is below the above | ||
requirements, you can follow the [Before installing](#before-installing) | ||
section below to manually compile from source. It is also always recommended to | ||
build from source to ensure consistency of the compiled module. | ||
## Before Installing | ||
> You can skip this section if the prebuilt binaries work for you. | ||
## Before installing | ||
*You can skip this section if the [prebuilt binaries](#prebuilt-binaries) work for you.* | ||
@@ -122,3 +91,3 @@ You **MUST** have a **node-gyp** global install before proceeding with the install, | ||
**node-argon2** works only and is tested against Node >=12.0.0. | ||
**node-argon2** works only and is tested against Node >=14.0.0. | ||
@@ -141,6 +110,6 @@ ### OSX | ||
```console | ||
$ CXX=g++-6 npm install argon2 | ||
$ CXX=g++-12 npm install argon2 | ||
``` | ||
**NOTE**: If your GCC or Clang binary is named something different than `g++-6`, | ||
**NOTE**: If your GCC or Clang binary is named something different than `g++-12`, | ||
you'll need to specify that in the command. | ||
@@ -153,10 +122,11 @@ | ||
```bash | ||
$ npx node-pre-gyp rebuild -C ./node_modules/argon2 | ||
$ npx @mapbox/node-pre-gyp rebuild -C ./node_modules/argon2 | ||
``` | ||
Run `node-pre-gyp` instead of `node-gyp` because node-argon2's `binding.gyp` | ||
file relies on variables from `node-pre-gyp`. | ||
Run `@mapbox/node-pre-gyp` instead of `node-gyp` because node-argon2's | ||
`binding.gyp` file relies on variables from `@mapbox/node-pre-gyp`. | ||
You can omit `npx` if you have a global installation of `node-pre-gyp`, | ||
otherwise prefixing `npx` will use the local one in `./node_modules/.bin` | ||
You can omit `npx @mapbox` and use just `node-pre-gyp` if you have a global | ||
installation of `@mapbox/node-pre-gyp`, otherwise prefixing `npx` will use | ||
the local one in `./node_modules/.bin` | ||
</details> | ||
@@ -179,3 +149,3 @@ | ||
$ npm install argon2 --ignore-scripts | ||
$ npx node-pre-gyp rebuild -C ./node_modules/argon2 | ||
$ npx @mapbox/node-pre-gyp rebuild -C ./node_modules/argon2 | ||
``` | ||
@@ -192,2 +162,20 @@ </details> | ||
### Differences from [node-argon2-ffi](https://github.com/cjlarose/argon2-ffi) | ||
The interface of both are very similar, notably, node-argon2-ffi splits the | ||
argon2i and argon2d function set, but this module also has the argon2id option, | ||
which node-argon2-ffi **does not support**. Also, while node-argon2-ffi | ||
suggests you promisify `crypto.randomBytes`, node-argon2 library does that | ||
internally. | ||
**node-argon2** is much lighter than **node-argon2-ffi**, at 184 KB for | ||
argon2@0.29.1 against 2.56 MB for argon2-ffi@1.2.0. Performance-wise, the | ||
libraries are equal. You can run the same benchmark suite if you are curious, | ||
but both can perform around 130 hashes/second on an Intel Core i5-4460 @ 3.2GHz | ||
with default options. | ||
This library is implemented natively, meaning it is an extension to the node | ||
engine. Thus, half of the code is C++ bindings, the other half is Javascript | ||
functions. node-argon2-ffi uses ffi, a mechanism to call functions from one | ||
language in another, and handles the type bindings (e.g. JS Number -> C++ int). | ||
## Contributors | ||
@@ -194,0 +182,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
180118
23
219
Updated@mapbox/node-pre-gyp@^1.0.10