4.4.2 • Published 1 month ago

@i-xi-dev/bytes v4.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@i-xi-dev/bytes

A JavaScript byte array library for the browser, Deno and Node.js

Requirement

ByteSequence.fromBlob, ByteSequence.prototype.toBlob and ByteSequence.prototype.toStream methods

These require Blob.

ChromeEdgeFirefoxSafariDenoNode.js
15.7+

ByteSequence.prototype.toFile method

This requires File.

ChromeEdgeFirefoxSafariDenoNode.js
19.2+

ByteSequence.fromStream method

This requires ReadableStream.

ChromeEdgeFirefoxSafariDenoNode.js
16.5+

ByteSequence.fromRequestOrResponse, ByteSequence.prototype.toRequest and ByteSequence.prototype.toResponse methods

These require Request and Response.

ChromeEdgeFirefoxSafariDenoNode.js
18.0+

ByteSequence.generateRandom, ByteSequence.prototype.toSha256Digest, ByteSequence.prototype.toSha384Digest and ByteSequence.prototype.toSha512Digest and ByteSequence.prototype.toSha1Digest methods, ByteSequence.prototype.sha256Integrity, ByteSequence.prototype.sha384Integrity and ByteSequence.prototype.sha512Integrity properties

These require Crypto.

ChromeEdgeFirefoxSafariDenoNode.js
15.0+

Other than above

ChromeEdgeFirefoxSafariDenoNode.js

Installation

npm

$ npm i @i-xi-dev/bytes@4.4.2
import { ByteSequence, ByteOrder } from "@i-xi-dev/bytes";

CDN

Example for UNPKG

import { ByteSequence, ByteOrder } from "https://www.unpkg.com/@i-xi-dev/bytes@4.4.2/esm/mod.js";

Usage

ByteSequence class

Conversion


Creating an instance

Creates an instance with a new underlying buffer

Creates an instance with the specified underlying buffer


Converting the instance to an ArrayBuffer


Converting the instance to an ArrayBufferView


Converting the instance to a number array


Converting the instance to a binary string


Converting the instance to a string containing Base64 encoded bytes


Converting the instance to a string containing percent encoded bytes


Converting the instance to a string based on the specified format


Converting the instance to a text


Converting the instance to a Blob


Converting the instance to a File

Node.js not support the File object


Converting the instance to a data URL


Converting the instance to a ReadableStream


Converting the instance to a Request


Converting the instance to a Response


Generating a digest of the instance


Generating a subresource integrity value of the instance


Editing the byte sequence

Gets the underlying ArrayBuffer

Gets the ArrayBufferView that views the underlying ArrayBuffer


Duplicating the byte sequence

Duplicates with the new underlying ArrayBuffer

Duplicates the subsequence with the new underlying ArrayBuffer


Comparing the byte sequence

Examples

4.4.2

1 month ago

4.4.0

4 months ago

4.3.0

4 months ago

4.2.0

5 months ago

4.1.10

5 months ago

4.1.3

10 months ago

4.1.2

10 months ago

4.1.0

1 year ago

4.1.1

1 year ago

4.0.3

2 years ago

3.0.0

2 years ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

0.0.22

3 years ago

0.0.21

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago