]> git.codecow.com Git - libnemo.git/commitdiff
Remove unused function. Formatting.
authorChris Duncan <chris@zoso.dev>
Mon, 1 Dec 2025 07:13:52 +0000 (23:13 -0800)
committerChris Duncan <chris@zoso.dev>
Mon, 1 Dec 2025 07:13:52 +0000 (23:13 -0800)
src/lib/crypto/secp256k1.ts

index 791ce9dcd24ba9e44e8e7b39f01e1fd983cb7b13..e59e0e5aea2e0f7d44f1d6220d9e584ccedb2e54 100644 (file)
@@ -154,9 +154,9 @@ export class Secp256k1 {
                this.captureTrace(e, this.err)
                throw e
        }
+       /** Asserts something is Uint8Array. */
        static isBytes = (a: unknown): a is Uint8Array =>
                a instanceof Uint8Array || (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array')
-       /** Asserts something is Uint8Array. */
        static abytes = (value: Bytes, length?: number, title: string = ''): Bytes => {
                const bytes = this.isBytes(value)
                const len = value?.length
@@ -172,9 +172,7 @@ export class Secp256k1 {
        /** create Uint8Array */
        static u8n = (len: number): Bytes => new Uint8Array(len)
        static bytesToHex = (b: Bytes): string =>
-               Array.from(this.abytes(b))
-                       .map((e) => e.toString(16).padStart(2, '0'))
-                       .join('')
+               Array.from(this.abytes(b)).map((e) => e.toString(16).padStart(2, '0')).join('')
        static C = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const // ASCII characters
        static _ch = (ch: number): number | undefined => {
                if (ch >= this.C._0 && ch <= this.C._9) return ch - this.C._0 // '2' => 50-48
@@ -235,7 +233,6 @@ export class Secp256k1 {
                if (typeof fn !== 'function') this.err('hashes.' + name + ' not set')
                return fn
        }
-       static hash = (msg: Bytes): Bytes => this.callHash('sha256')(msg)
        // ## End of Helpers
        // -----------------