Securely zeros out a Uint8Array in-place to minimize the exposure window of sensitive cryptographic material in memory.
The buffer to overwrite with zeros.
import { wipeMemory } from "@sebastienrousseau/crypto-lib";const keyBytes = new Uint8Array([1, 2, 3, 4]);wipeMemory(keyBytes);// keyBytes is now all zeros: [0, 0, 0, 0] Copy
import { wipeMemory } from "@sebastienrousseau/crypto-lib";const keyBytes = new Uint8Array([1, 2, 3, 4]);wipeMemory(keyBytes);// keyBytes is now all zeros: [0, 0, 0, 0]
Securely zeros out a Uint8Array in-place to minimize the exposure window of sensitive cryptographic material in memory.