Skip to content

Commit

Permalink
Version 4.1.0 (architecture-specific builds)
Browse files Browse the repository at this point in the history
- "sse" variant built on x86_64 and x86

- "neon" variant built on arm64

- "ref" (generic) variant built on other platforms

- Switched CI from Travis to GitHub Actions

- Upgrade nan to 2.15.0 (latest)
  • Loading branch information
vrza committed Jan 13, 2022
1 parent 3e80100 commit 1a5cfc5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node-blake2
===
# node-blake2

[![NPM version][npm-image]][npm-url]
[![Build status][github-actions-image]][github-actions-url]
Expand All @@ -19,39 +18,36 @@ node-blake2 was tested to work with the following compilers and platforms:
| GCC 8.3.0 10.2.0, 11.2.0 | GNU/Linux Gentoo | x86_64 |
| LLVM clang 11.1.0, 13.0.0 | GNU/Linux Gentoo | x86_64 |
| GCC 5.4.0 | GNU/Linux Ubuntu 16.04 | x86_64 |
| LLVM clang 11.1.0 | OpenBSD 7.0 | x86_64 |
| Apple LLVM clang 9.1.0 | macOS 10.13 | x86_64 |
| Visual Studio 2019 | Windows 11 | x86_64 |
| Visual Studio 2015 | Windows 10 | x86_64 |
| GCC 10.2.1 | GNU/Linux Debian 11.2 | aarch64 Cortex-A57 |
| Apple LLVM clang 12.0.5 | macOS 12 | aarch64 Apple M1 |

Prerequisites for building on Windows
---
## Prerequisites for building on Windows

[Visual Studio Build Tools](https://github.com/felixrieseberg/windows-build-tools).

Python is required by [node-gyp](https://github.com/nodejs/node-gyp).

Starting with Node.js 12, Windows installer can automatically install Python and Visual Studio build tools.

Install
---
## Install

In your project, run:

```
```sh
npm install blake2 --save
```

or install from the GitHub repo:

```
```sh
npm install vrza/node-blake2 --save
```


Examples
---
## Examples

### Unkeyed BLAKE2b

Expand Down Expand Up @@ -80,11 +76,10 @@ Although it is not an HMAC, a keyed hash serves the same purpose.

### Important notes

- `blake2.create{Hash,KeyedHash}` support algorithms `blake2b`, `blake2bp`,
`blake2s`, and `blake2sp`.
- Data passed to `.update` on `blake2.{Hash,KeyedHash}` must be a `Buffer`.
- Keys passed to `blake2.createKeyedHash(algo, key)` must be a `Buffer`.
- Just as with `crypto.Hash`, `.digest()` can only be called once.
- `blake2.create{Hash,KeyedHash}` support algorithms `blake2b`, `blake2bp`, `blake2s`, and `blake2sp`.
- Data passed to `.update` on `blake2.{Hash,KeyedHash}` must be a `Buffer`.
- Keys passed to `blake2.createKeyedHash(algo, key)` must be a `Buffer`.
- Just as with `crypto.Hash`, `.digest()` can only be called once.

### With streams

Expand Down Expand Up @@ -134,10 +129,9 @@ console.log(h.digest());
console.log(j.digest());
```

Known issues
---
## Known issues

- On Windows, node-blake2 requires enabling AVX instructions as a workaround for the way upstream build preprocessor detects support for SSE2.
- On Windows, node-blake2 requires enabling AVX instructions as a workaround for the way upstream build preprocessor detects support for SSE2.

[npm-image]: https://img.shields.io/npm/v/blake2.svg
[npm-url]: https://npmjs.org/package/blake2
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blake2",
"version": "4.0.3",
"version": "4.1.0",
"description": "All four BLAKE2 variants (blake2b, blake2bp, blake2s, blake2sp) for node, with stream support",
"keywords": [
"crypto",
Expand All @@ -20,7 +20,7 @@
},
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/mocha tests/*.js && ./node_modules/.bin/eslint ."
"test": "node node_modules/eslint/bin/eslint . && node node_modules/mocha/bin/mocha tests"
},
"dependencies": {
"nan": "^2.15.0"
Expand Down

0 comments on commit 1a5cfc5

Please sign in to comment.