1.0.15 • Published 10 months ago

@hazae41/base64 v1.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Base64

Base64 adapter for WebAssembly and JS implementations

npm i @hazae41/base64

Node Package 📦

Features

Current features

  • 100% TypeScript and ESM
  • No external dependencies

Getting started

Buffer (NodeJS)

import { Base64 } from "@hazae41/base64"

Base64.set(Base64.fromBuffer())

WebAssembly

npm i @hazae41/base64.wasm
import { Base64 } from "@hazae41/base64"
import { Base64Wasm } from "@hazae41/base64.wasm"

await Base64Wasm.initBundled()

Base64.set(Base64.fromBufferOrWasm(Base64Wasm))

Scure (JavaScript)

npm i @scure/base
import { Base64 } from "@hazae41/base64"
import * as Scure from "@scure/base"

Base64.set(Base64.fromBufferOrScure(Scure))

Usage

const encoded: string = Base64.get().getOrThrow().encodePaddedOrThrow(new Uint8Array([1,2,3,4,5]))
using decoded: Copiable = Base64.get().getOrThrow().decodePaddedOrThrow(encoded)
const decoded2: Uint8Array = decoded.bytes.slice()
1.0.11

11 months ago

1.0.15

10 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago