Bytes class

表示位元組數組的不可變物件。

簽名:

export declare class Bytes 

方法

方法修飾符描述
來自Base64String(base64) static從給定的 Base64 字串建立一個新的Bytes對象,並將其轉換為位元組。
fromUint8Array(數組) static從給定的 Uint8Array 建立一個新的Bytes物件。
是否等於(其他)如果此Bytes物件等於提供的對象,則傳回 true。
toBase64()以 Base64 編碼字串形式傳回基礎位元組。
toString()傳回Bytes物件的字串表示形式。
toUint8Array()傳回新Uint8Array中的基礎位元組。

Bytes.fromBase64String()

從給定的 Base64 字串建立一個新的Bytes對象,並將其轉換為位元組。

簽名:

static fromBase64String(base64: string): Bytes;

參數

範圍類型描述
64位基數細繩用於建立Bytes物件的 Base64 字串。

返回:

位元組

Bytes.fromUint8Array()

從給定的 Uint8Array 建立一個新的Bytes物件。

簽名:

static fromUint8Array(array: Uint8Array): Bytes;

參數

範圍類型描述
大批Uint8Array Uint8Array 用於建立Bytes物件。

返回:

位元組

Bytes.isEqual()

如果此Bytes物件等於提供的對象,則傳回 true。

簽名:

isEqual(other: Bytes): boolean;

參數

範圍類型描述
其他位元組要比較的Bytes物件。

返回:

布林值

如果此Bytes對像等於提供的對象,則為 true。

位元組.toBase64()

以 Base64 編碼字串形式傳回基礎位元組。

簽名:

toBase64(): string;

返回:

細繩

Bytes物件建立的 Base64 編碼字串。

位元組.toString()

傳回Bytes物件的字串表示形式。

簽名:

toString(): string;

返回:

細繩

Bytes物件的字串表示形式。

Bytes.toUint8Array()

傳回新Uint8Array中的基礎位元組

簽名:

toUint8Array(): Uint8Array;

返回:

Uint8Array

Bytes物件建立的 Uint8Array。