包详细信息

@oslojs/encoding

oslo-project2.5mMIT1.1.0

Runtime-agnostic library for encoding and decoding data

auth, encoding, hex, base16

自述文件

@oslojs/encoding

Documentation: https://encoding.oslojs.dev

A JavaScript library for encoding and decoding data with hexadecimal, base32, base64, and base64url encoding schemes based on RFC 4648. Implementations may be stricter than most to follow the RFC as close as possible.

  • Runtime-agnostic
  • No third-party dependencies
  • Fully typed
import { encodeBase64, decodeBase64 } from "@oslojs/encoding";

const data: Uint8Array = new TextEncoder().encode("hello world");
const encoded = encodeBase64(data);
const decoded = decodeBase64(encoded);

Installation

npm i @oslojs/encoding

更新日志

@oslojs/encoding

1.1.0

  • Add encodeBase32UpperCase(), encodeBase32UpperCaseNoPadding(), encodeBase32LowerCase(), and encodeBase32LowerCaseNoPadding().

1.0.0

  • No changes.

0.4.1

  • Remove redundant code.

0.4.0

  • [Breaking] Replace base64, bas64url, and base32
  • [Breaking] Remove base32
  • [Breaking] Replace encodeHex() with encodeHexLowerCase() and encodeHexUpperCase().
  • [Breaking] Remove Encoding interface.

0.3.0

  • [Breaking] Add Encoding.encodeNoPadding() and Encoding.decodeIgnorePadding()
  • [Breaking] Remove includingPadding option from Base64Encoding.encode() and Base32Encoding.encode()
  • [Breaking] Remove strict option from Base64Encoding.decodeIgnorePadding() and Base32Encoding.decodeIgnorePadding()
  • Add Encoding.encodeNoPadding(), Base64Encoding.encodeNoPadding(), Base32Encoding.encodeNoPadding()
  • Add Encoding.decodeIgnorePadding(), Base64Encoding.decodeIgnorePadding(), Base32Encoding.decodeIgnorePadding()