@hazae41/sha1
TypeScript icon, indicating that this package has built-in type declarations

1.1.12 • Public • Published

Sha1

SHA-1 adapter for WebAssembly and JS implementations

npm i @hazae41/sha1

Node Package 📦

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies

Getting started

Morax (WebAssembly)

npm i @hazae41/morax
import { Sha1 } from "@hazae41/sha1"

Sha1.set(await Sha1.fromMorax())

Noble (JavaScript)

npm i @noble/hashes
import { Sha1 } from "@hazae41/sha1"

Sha1.set(Sha1.fromNoble())

Usage

Direct

const hashed: Uint8Array = Sha1.get().tryHash(new Uint8Array([1,2,3,4,5])).unwrap().copyAndDispose()

Incremental

const hasher = Sha1.get().Hasher.tryNew().unwrap()
hasher.tryUpdate(new Uint8Array([1,2,3,4,5])).unwrap()
const hashed: Uint8Array = hasher.tryFinalize().unwrap().copyAndDispose()

/@hazae41/sha1/

    Package Sidebar

    Install

    npm i @hazae41/sha1

    Weekly Downloads

    103

    Version

    1.1.12

    License

    MIT

    Unpacked Size

    95.8 kB

    Total Files

    36

    Last publish

    Collaborators

    • hazae41