mirror of
https://github.com/UneBaguette/blake3.wasm.git
synced 2026-08-07 00:00:16 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59cd38b35b
|
||
|
|
a841ee1313
|
||
|
|
ac63099741
|
||
|
|
2de1b09087
|
||
|
|
112db2e0fe
|
||
|
|
90e9a905b0
|
||
|
|
7e7ee43bad
|
||
|
|
d3871afb58
|
@@ -15,17 +15,16 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
|
||||
|
||||
- name: Install wasm-pack
|
||||
run: |
|
||||
curl -L https://github.com/rustwasm/wasm-pack/releases/download/v0.14.0/wasm-pack-v0.14.0-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
curl -L https://github.com/wasm-bindgen/wasm-pack/releases/download/v${{ vars.WASM_PACK_VERSION }}/wasm-pack-v${{ vars.WASM_PACK_VERSION }}-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
sudo mv wasm-pack-*/wasm-pack /usr/local/bin/
|
||||
|
||||
- name: Install wasm-bindgen-cli
|
||||
run: |
|
||||
curl -L https://github.com/wasm-bindgen/wasm-bindgen/releases/download/0.2.118/wasm-bindgen-0.2.118-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
sudo mv wasm-bindgen-*/wasm-bindgen /usr/local/bin/
|
||||
curl -L https://github.com/wasm-bindgen/wasm-bindgen/releases/download/${{ vars.WASM_BINDGEN_VERSION }}/wasm-bindgen-${{ vars.WASM_BINDGEN_VERSION }}-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
sudo mv wasm-bindgen-*/wasm-bindgen-test-runner /usr/local/bin/
|
||||
|
||||
- name: Rust tests
|
||||
|
||||
@@ -14,22 +14,28 @@ jobs:
|
||||
contents: read
|
||||
id-token: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4
|
||||
with:
|
||||
node-version: '24.16.0'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Install wasm-pack
|
||||
run: |
|
||||
curl -L https://github.com/wasm-bindgen/wasm-pack/releases/download/v0.14.0/wasm-pack-v0.14.0-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
curl -L https://github.com/wasm-bindgen/wasm-pack/releases/download/v${{ vars.WASM_PACK_VERSION }}/wasm-pack-v${{ vars.WASM_PACK_VERSION }}-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
sudo mv wasm-pack-*/wasm-pack /usr/local/bin/
|
||||
|
||||
- name: Install wasm-bindgen-cli
|
||||
run: |
|
||||
curl -L https://github.com/wasm-bindgen/wasm-bindgen/releases/download/0.2.118/wasm-bindgen-0.2.118-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
curl -L https://github.com/wasm-bindgen/wasm-bindgen/releases/download/${{ vars.WASM_BINDGEN_VERSION }}/wasm-bindgen-${{ vars.WASM_BINDGEN_VERSION }}-x86_64-unknown-linux-musl.tar.gz | tar xz
|
||||
sudo mv wasm-bindgen-*/wasm-bindgen /usr/local/bin/
|
||||
sudo mv wasm-bindgen-*/wasm-bindgen-test-runner /usr/local/bin/
|
||||
|
||||
- name: Install wasm-opt
|
||||
run: |
|
||||
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_129/binaryen-version_129-x86_64-linux.tar.gz | tar xz
|
||||
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_${{ vars.WASM_OPT_VERSION }}/binaryen-version_${{ vars.WASM_OPT_VERSION }}-x86_64-linux.tar.gz | tar xz
|
||||
sudo mv binaryen-*/bin/wasm-opt /usr/local/bin/
|
||||
|
||||
- name: Rust tests
|
||||
@@ -44,4 +50,4 @@ jobs:
|
||||
- name: Publish to npm
|
||||
run: |
|
||||
cd pkg
|
||||
npm publish --access public --provenance
|
||||
npm publish
|
||||
|
||||
Generated
+19
-20
@@ -57,7 +57,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "blake3-wasm-rs"
|
||||
version = "0.6.2"
|
||||
version = "0.6.6"
|
||||
dependencies = [
|
||||
"blake3",
|
||||
"hex",
|
||||
@@ -153,13 +153,12 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.95"
|
||||
version = "0.3.100"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca"
|
||||
checksum = "f2025f20d7a4fa7785846e7b63d10a76d3f1cee98ee5cb79ea59703f95e42162"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"futures-util",
|
||||
"once_cell",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
@@ -370,9 +369,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.118"
|
||||
version = "0.2.123"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89"
|
||||
checksum = "a254a4b10c19a76f09a27640e7ffbf9bc30bf67e16a3bf28aaefa4920fe81563"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
@@ -383,9 +382,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-futures"
|
||||
version = "0.4.68"
|
||||
version = "0.4.73"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f371d383f2fb139252e0bfac3b81b265689bf45b6874af544ffa4c975ac1ebf8"
|
||||
checksum = "54568702fabf5d4849ce2b90fadfa64168a097eaf4b351ce9df8b687a0086aaf"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
@@ -393,9 +392,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.118"
|
||||
version = "0.2.123"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed"
|
||||
checksum = "24a40fc75b0ec6f3746ceb10d36f53a93dcd68a93b11b6445983945d79eba0dc"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
@@ -403,9 +402,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.118"
|
||||
version = "0.2.123"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904"
|
||||
checksum = "908f34bd9b9ce3d4caf07b72dfab63d61504d156856c6bd3cd87fa350cf3985b"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"proc-macro2",
|
||||
@@ -416,18 +415,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.118"
|
||||
version = "0.2.123"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129"
|
||||
checksum = "7acbf7616c27b194bbb550bf77ed0c2c3e5b7fd1260a93082b95fb7f47959b92"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-test"
|
||||
version = "0.3.68"
|
||||
version = "0.3.73"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6bb55e2540ad1c56eec35fd63e2aea15f83b11ce487fd2de9ad11578dfc047ea"
|
||||
checksum = "e28a0782b173cf2e98f62aacb487c5c021b7c5925df46098675f28e1fa85e159"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"cast",
|
||||
@@ -447,9 +446,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-test-macro"
|
||||
version = "0.3.68"
|
||||
version = "0.3.73"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "caf0ca1bd612b988616bac1ab34c4e4290ef18f7148a1d8b7f31c150080e9295"
|
||||
checksum = "ee997551ce1ad5adda03f7ce37ec34b4140fe9f547fd07b46d55901d1ba1a06b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -458,9 +457,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-test-shared"
|
||||
version = "0.2.118"
|
||||
version = "0.2.123"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23cda5ecc67248c48d3e705d3e03e00af905769b78b9d2a1678b663b8b9d4472"
|
||||
checksum = "ae0f005eb61f765eff31a79ef71df7e21819731268a868df41192c1e41d6d3e5"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-util"
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "blake3-wasm-rs"
|
||||
version = "0.6.2"
|
||||
version = "0.6.6"
|
||||
edition = "2024"
|
||||
license = "MIT OR Apache-2.0"
|
||||
authors = ["Thomas <[email protected]>"]
|
||||
@@ -21,7 +21,7 @@ zeroize = ["blake3/zeroize"]
|
||||
|
||||
[dependencies]
|
||||
blake3 = { version = "1", features = ["wasm32_simd"] }
|
||||
wasm-bindgen = { version = "=0.2.118", optional = true }
|
||||
wasm-bindgen = { version = "=0.2.123", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
wasm-bindgen-test = "0.3"
|
||||
|
||||
@@ -26,6 +26,7 @@ build-all:
|
||||
$(WASM_BINDGEN) --target web --out-dir $(ROOT)/web $(TARGET_DIR)/$(CRATE).wasm
|
||||
$(WASM_BINDGEN) --target nodejs --out-dir $(ROOT)/node $(TARGET_DIR)/$(CRATE).wasm
|
||||
@mv $(ROOT)/bundler/$(CRATE)_bg.wasm $(ROOT)/$(CRATE)_bg.wasm
|
||||
@cp $(ROOT)/bundler/$(CRATE)_bg.js $(ROOT)/$(CRATE)_bg.js
|
||||
@rm -f $(ROOT)/web/$(CRATE)_bg.wasm $(ROOT)/node/$(CRATE)_bg.wasm
|
||||
$(WASM_OPT) $(WASM_OPT_FLAGS) $(ROOT)/$(CRATE)_bg.wasm -o $(ROOT)/$(CRATE)_bg.wasm
|
||||
@node -e "['bundler','web','node'].forEach(d=>{const f='$(ROOT)/'+d+'/$(CRATE).js';require('fs').writeFileSync(f,require('fs').readFileSync(f,'utf8').replace(/$(CRATE)_bg\.wasm/g,'../$(CRATE)_bg.wasm'))})"
|
||||
@@ -44,17 +45,18 @@ build-all:
|
||||
type: 'module',\
|
||||
version: '$(VERSION)',\
|
||||
description: 'BLAKE3 hashing via Rust/WASM - works in Node.js (CJS + ESM), browsers, and bundlers',\
|
||||
license: 'MIT',\
|
||||
license: 'MIT OR Apache-2.0',\
|
||||
repository: { type: 'git', url: 'https://github.com/UneBaguette/blake3.wasm' },\
|
||||
main: 'index.js',\
|
||||
types: 'index.d.ts',\
|
||||
exports: { '.': {\
|
||||
types: './index.d.ts',\
|
||||
node: { require: './node/$(CRATE).js', import: './node-esm/index.mjs' },\
|
||||
import: './bundler/$(CRATE).js',\
|
||||
webpack: './bundler/$(CRATE).js',\
|
||||
import: './web/$(CRATE).js',\
|
||||
default: './web/$(CRATE).js'\
|
||||
}},\
|
||||
files: ['bundler/', 'web/', 'node/', 'node-esm/', 'index.js', 'index.d.ts', '$(CRATE)_bg.wasm', 'README.md', 'LICENSE'],\
|
||||
files: ['bundler/', 'web/', 'node/', 'node-esm/', 'index.js', 'index.d.ts', '$(CRATE)_bg.wasm', '$(CRATE)_bg.js', 'README.md', 'LICENSE'],\
|
||||
keywords: ['blake3', 'wasm', 'hash', 'cryptography', 'wasm-bindgen']\
|
||||
};\
|
||||
require('fs').writeFileSync('./$(ROOT)/package.json', JSON.stringify(pkg, null, 2) + '\n');"
|
||||
|
||||
Vendored
+3
-1
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
// Copyright 2026 Thomas <[email protected]>
|
||||
// @ts-nocheck
|
||||
export { Hasher, deriveKey, hash, hashXof, keyedHash } from './bundler/blake3_wasm_rs';
|
||||
export { Hasher, deriveKey, hash, hashXof, keyedHash } from './bundler/blake3_wasm_rs';
|
||||
|
||||
export { default } from './web/blake3_wasm_rs';
|
||||
|
||||
Reference in New Issue
Block a user