]> git.codecow.com Git - libnemo.git/commitdiff
Remove unused convert functions.
authorChris Duncan <chris@zoso.dev>
Mon, 21 Jul 2025 20:19:18 +0000 (13:19 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 21 Jul 2025 20:19:18 +0000 (13:19 -0700)
src/lib/convert.ts

index 51a4cbb695b18f0eb87498d7ff7f3240d6a00c1d..32d70674a3eba564bf761fc4402c0fb306ed0d02 100644 (file)
@@ -53,16 +53,6 @@ export class bin {
                }\r
                return new Uint8Array(bytes)\r
        }\r
-\r
-       /**\r
-       * Convert a binary string to a hexadecimal string.\r
-       *\r
-       * @param {string} bin - String to convert\r
-       * @returns {string} Hexadecimal string representation of the input binary\r
-       */\r
-       static toHex (bin: string): string {\r
-               return parseInt(bin, 2).toString(16)\r
-       }\r
 }\r
 \r
 export class bytes {\r
@@ -85,26 +75,6 @@ export class bytes {
                bytes.buffer.transfer()\r
        }\r
 \r
-       /**\r
-       * Convert a Uint8Array to an array of decimal byte values.\r
-       *\r
-       * @param {Uint8Array} bytes - Byte array to convert\r
-       * @param {number}[padding=0] - Minimum length of the resulting array padded as necessary with starting 0 values\r
-       * @returns {number[]} Decimal array representation of the input value\r
-       */\r
-       static toArray (bytes: Uint8Array<ArrayBuffer>, padding: number = 0): number[] {\r
-               if (!(bytes instanceof Uint8Array)) {\r
-                       throw new TypeError('bytes must be Uint8Array')\r
-               }\r
-               const byteArray = [...bytes.values()]\r
-               padding -= bytes.byteLength\r
-               if (padding > 0) {\r
-                       const zeros = new Array(padding)\r
-                       byteArray.splice(0, 0, ...zeros)\r
-               }\r
-               return byteArray\r
-       }\r
-\r
        /**\r
        * Convert a Uint8Aarray of bytes to a base32 string.\r
        *\r