1.1.17 • Published 7 months ago
@hazae41/sha1 v1.1.17
Sha1
SHA-1 adapter for WebAssembly and JS implementations
npm i @hazae41/sha1Features
Current features
- 100% TypeScript and ESM
- No external dependencies
Getting started
WebAssembly
npm i @hazae41/sha1.wasmimport { Sha1 } from "@hazae41/sha1"
import { Sha1Wasm } from "@hazae41/sha1.wasm"
await Sha1Wasm.initBundled()
Sha1.set(Sha1.fromWasm(Sha1Wasm))Noble (JavaScript)
npm i @noble/hashesimport { Sha1 } from "@hazae41/sha1"
import Sha1Noble from "@noble/hashes/sha1"
Sha1.set(Sha1.fromNoble(Noble))Usage
Direct
using hashed: Copiable = Sha1.get().getOrThrow().hashOrThrow(new Uint8Array([1,2,3,4,5]))
const hashed2: Uint8Array = hashed.bytes.slice()Incremental
using hasher: Sha1.Hasher = Sha1.get().getOrThrow().Hasher.createOrThrow()
hasher.updateOrThrow(new Uint8Array([1,2,3,4,5]))
hasher.updateOrThrow(new Uint8Array([6,7,8,9,10]))
using hashed: Copiable = hasher.finalizeOrThrow()
const hashed2: Uint8Array = hashed.bytes.slice()1.1.17
7 months ago
1.1.16
7 months ago
1.1.15
8 months ago
1.1.14
1 year ago
1.1.13
1 year ago
1.1.1
2 years ago
1.1.0
2 years ago
1.1.9
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.12
2 years ago
1.1.11
2 years ago
1.1.10
2 years ago
1.0.2
3 years ago
1.0.0
3 years ago