return new Bytes(length)
}
+/** Captured version of `Array.push(value)`. */
+export const arrayPush = Function.prototype.call.bind(Array.prototype.push)
+
/** Captured version of `Uint8Array.prototype.byteLength`. */
export function byteLength (bytes: Uint8Array): number {
return getByteLength(bytes)
//! SPDX-FileCopyrightText: 2026 Chris Duncan <chris@codecow.com>
//! SPDX-License-Identifier: GPL-3.0-or-later
-import { allocate, byteLength, copy, isArray, normalize } from './primordials'
+import { allocate, byteLength, copy, isArray, normalize, arrayPush } from './primordials'
import { Mutex, constants, getOutput, setInput, verify as wasm_verify, verify_blocks as wasm_verify_blocks, } from './wasm'
const { BLOCKHASH_BYTELENGTH, KEY_BYTELENGTH, MAX_MESSAGE_BYTELENGTH, MAX_VERIFY_BLOCKS, SIGNATURE_BYTELENGTH, } = constants
setInput('msg', message)
wasm_verify_blocks(count)
for (let i = 0; i < count; i++) {
- verified[i] = getOutput('verify', i) === 1
+ arrayPush(verified, getOutput('verify', i) === 1)
}
return verified
} finally {