1.0.3 • Published 3 years ago

bytes.ts v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Bytes

Utilities for manipulating bytes, written in TypeScript.

Installation

npm install bytes.ts

Types

Endianness

Represents either "little" or "big" endian.

Encoding

An exported alias for BufferEncoding for completeness.

Functions

Utilities

concatBytes(...list: Buffer[]): Buffer

String

bytesToString(bytes: Buffer, encoding: Encoding): string
stringToBytes(text: string, encoding: Encoding): Buffer

Hex

bytesToHex(bytes: Buffer): string
hexToBytes(hex: string): Buffer

BigInt

bytesToInt(bytes: Buffer, endianness: Endianness): bigint
intToBytes(int: bigint, size: number, endianness: Endianness): Buffer

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago