BitVM / blake3

BLAKE3 extracted from the reference implementation and compiled to WebAssembly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BLAKE3 WASM

BLAKE3 implementation extracted from the reference implementation and compiled to WebAssembly.

Usage

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:

clang src/blake3.cpp -O2 --no-standard-libraries -mbulk-memory --target=wasm32 -Wl,--no-entry -o blake3.wasm

About

BLAKE3 extracted from the reference implementation and compiled to WebAssembly


Languages

Language:C++ 67.7%Language:C 30.9%Language:JavaScript 1.4%