From f30cdff6de582e73313ad9906ba3dc84169031df Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 21 Jul 2025 13:19:18 -0700 Subject: [PATCH] Remove unused convert functions. --- src/lib/convert.ts | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/lib/convert.ts b/src/lib/convert.ts index 51a4cbb..32d7067 100644 --- a/src/lib/convert.ts +++ b/src/lib/convert.ts @@ -53,16 +53,6 @@ export class bin { } return new Uint8Array(bytes) } - - /** - * Convert a binary string to a hexadecimal string. - * - * @param {string} bin - String to convert - * @returns {string} Hexadecimal string representation of the input binary - */ - static toHex (bin: string): string { - return parseInt(bin, 2).toString(16) - } } export class bytes { @@ -85,26 +75,6 @@ export class bytes { bytes.buffer.transfer() } - /** - * Convert a Uint8Array to an array of decimal byte values. - * - * @param {Uint8Array} bytes - Byte array to convert - * @param {number}[padding=0] - Minimum length of the resulting array padded as necessary with starting 0 values - * @returns {number[]} Decimal array representation of the input value - */ - static toArray (bytes: Uint8Array, padding: number = 0): number[] { - if (!(bytes instanceof Uint8Array)) { - throw new TypeError('bytes must be Uint8Array') - } - const byteArray = [...bytes.values()] - padding -= bytes.byteLength - if (padding > 0) { - const zeros = new Array(padding) - byteArray.splice(0, 0, ...zeros) - } - return byteArray - } - /** * Convert a Uint8Aarray of bytes to a base32 string. * -- 2.47.3