Skip to content

hazae41/base16

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 31, 2024
dcd4fe7 Â· Aug 31, 2024

History

49 Commits
Sep 4, 2023
Aug 31, 2024
Sep 4, 2023
Sep 4, 2023
Aug 31, 2024
Aug 31, 2024
Aug 31, 2024
Oct 9, 2023
Oct 12, 2023

Repository files navigation

Base16

Base16 adapter for WebAssembly and JS implementations

npm i @hazae41/base16

Node Package 📦

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies

Getting started

Buffer (NodeJS)

import { Base16 } from "@hazae41/base16"

Base16.set(Base16.fromBuffer())

WebAssembly

npm i @hazae41/base16.wasm
import { Base16 } from "@hazae41/base16"
import { Base16Wasm } from "@hazae41/base16.wasm"

await Base16Wasm.initBundled()

Base16.set(Base16.fromBufferOrWasm(Base16Wasm))

Scure (JavaScript)

npm i @scure/base
import { Base16 } from "@hazae41/base16"
import * as Scure from "@scure/base"

Base16.set(Base16.fromBufferOrScure(Scure))

Usage

const encoded: string = Base16.get().getOrThrow().encodeOrThrow(new Uint8Array([1,2,3,4,5]))
using decoded: Copiable = Base16.get().getOrThrow().decodeOrThrow(encoded)
const decoded2: Uint8Array = decoded.bytes.slice()

About

Base16 adapter for WebAssembly and JS implementations

Resources

Stars

Watchers

Forks

Packages

No packages published