Skip to content

Commit

Permalink
fix: simd override
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkeil committed Dec 19, 2024
1 parent 5462a4d commit 2844ada
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/as-sha256/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SHA256 from "./sha256.js";
export {HashObject, byteArrayToHashObject, hashObjectToByteArray, byteArrayIntoHashObject, SHA256};

let hasSimd = await simd();
if (`${process.env.DISABLE_SIMD}` === "true") {
if (process.env.DISABLE_SIMD === "true") {
hasSimd = false;
}

Expand All @@ -20,7 +20,7 @@ const outputUint8Array32 = new Uint8Array(ctx.memory.buffer, wasmOutputValue, 32
const inputUint32Array = new Uint32Array(ctx.memory.buffer, wasmInputValue, ctx.INPUT_LENGTH);

export function simdEnabled(): boolean {
return ctx.HAS_SIMD;
return Boolean(ctx.HAS_SIMD.valueOf());
}

export function digest(data: Uint8Array): Uint8Array {
Expand Down

0 comments on commit 2844ada

Please sign in to comment.