From: Chris Duncan Date: Mon, 1 Dec 2025 07:13:52 +0000 (-0800) Subject: Remove unused function. Formatting. X-Git-Tag: v0.11.0~12^2~1 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=6b2a9e715233212b8bd25598d733e4c22a771235;p=libnemo.git Remove unused function. Formatting. --- diff --git a/src/lib/crypto/secp256k1.ts b/src/lib/crypto/secp256k1.ts index 791ce9d..e59e0e5 100644 --- a/src/lib/crypto/secp256k1.ts +++ b/src/lib/crypto/secp256k1.ts @@ -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 // -----------------