(n: number): string Formats a byte count as a human-readable string.
n
byte count.
type
numberreturns
string formatted string like '1.2 KB' or '3.4 MB'.
Binary data conversion helpers.
2 declarations
(n: number): string Formats a byte count as a human-readable string.
nbyte count.
numberstring formatted string like '1.2 KB' or '3.4 MB'.
(data: string | BufferSource): Uint8Array<ArrayBufferLike> Converts string or binary data to a Uint8Array.
Strings are UTF-8 encoded. Uint8Array inputs are returned as-is.
dataString or BufferSource to convert.
string | BufferSourceUint8Array<ArrayBufferLike> Uint8Array view of the data.