Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Bytes

An immutable object representing an array of bytes.

class Bytes {
private constructor();
isEqual(other: Bytes): boolean;
toBase64(): string;
toString(): string;
toUint8Array(): Uint8Array;
 
static fromBase64String(base64: string): Bytes;
static fromUint8Array(array: Uint8Array): Bytes;
}

§Constructors

§
new Bytes() private
[src]

§Methods

§
isEqual(other: Bytes): boolean
[src]

Returns true if this Bytes object is equal to the provided one.

@param other
  • The Bytes object to compare against.
@return

true if this Bytes object is equal to the provided one.

§
toBase64(): string
[src]

Returns the underlying bytes as a Base64-encoded string.

@return

The Base64-encoded string created from the Bytes object.

§
toString(): string
[src]

Returns a string representation of the Bytes object.

@return

A string representation of the Bytes object.

§
toUint8Array(): Uint8Array
[src]

Returns the underlying bytes in a new Uint8Array.

@return

The Uint8Array created from the Bytes object.

§Static Methods

§
fromBase64String(base64: string): Bytes
[src]

Creates a new Bytes object from the given Base64 string, converting it to bytes.

@param base64
  • The Base64 string used to create the Bytes object.
§
fromUint8Array(array: Uint8Array): Bytes
[src]

Creates a new Bytes object from the given Uint8Array.

@param array
  • The Uint8Array used to create the Bytes object.