https://github.com/coins/blake3
JavaScript implementation of BLAKE3 extracted from the reference implementation and compiled to WebAssembly
https://github.com/coins/blake3
Last synced: 28 days ago
JSON representation
JavaScript implementation of BLAKE3 extracted from the reference implementation and compiled to WebAssembly
- Host: GitHub
- URL: https://github.com/coins/blake3
- Owner: coins
- Created: 2023-11-30T17:58:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-02T20:02:55.000Z (over 1 year ago)
- Last Synced: 2025-04-10T07:04:44.733Z (about 1 month ago)
- Language: C++
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-bitvm - BLAKE3 WASM
README
# BLAKE3 WASM
BLAKE3 implementation extracted from [the reference implementation](https://github.com/BLAKE3-team/BLAKE3/blob/master/c/blake3.c) and compiled to WebAssembly.
## Usage
```js
import {blake3} from 'https://bitvm.github.io/blake3/blake3.js'const preimage = new Uint8Array([97, 98, 99]) // Our preimage is "abc"
const digest = blake3(preimage)console.log(digest)
```## Development
The following command compiles the sources to wasm:
```sh
clang src/blake3.cpp -O2 --no-standard-libraries -mbulk-memory --target=wasm32 -Wl,--no-entry -o blake3.wasm
```