Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/encoding/binary.ts

Deno standard library
Go to Latest
import * as mod from "https://deno.land/std@0.74.0/encoding/binary.ts";

Functions

Reads n bytes from r.

Encodes bigint x into b. Returns the number of bytes used, or 0 if b is shorter than sizeof(o.dataType).

Encodes number x into b. Returns the number of bytes used, or 0 if b is shorter than sizeof(o.dataType).

Decodes a bigint from r, comsuming sizeof(o.dataType) bytes. If less than sizeof(o.dataType) bytes were read, throws Deno.errors.unexpectedEof.

Decodes a number from r, comsuming sizeof(o.dataType) bytes. If less than sizeof(o.dataType) bytes were read, throws Deno.errors.unexpectedEof.

Number of bytes required to store dataType.

Decodes a bigint from b. If o.bytes is shorter than sizeof(o.dataType), returns null.

Encodes x into a new Uint8Array.

Decodes a number from b. If o.bytes is shorter than sizeof(o.dataType), returns null.

Encodes x into a new Uint8Array.

Encodes and writes x to w. Resolves to the number of bytes written.

Encodes and writes x to w. Resolves to the number of bytes written.

Interfaces

Options for working with the bigint type.

Options for working with the number type.

Type Aliases

How encoded binary data is ordered.