Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
/**
* Overwrite `buf` in-place with zero bytes.
*
* JavaScript cannot guarantee the garbage collector has not already relocated
* or copied the underlying memory, so this is a best-effort operation. Its
* purpose is to minimise the time window during which sensitive bytes
* (secret keys, plaintext, derived material) remain readable on the heap
* after they are no longer needed. Combine with aggressive buffer
* scoping — allocate inside a function, zeroize, return nothing sensitive.
*/
export function zeroize(buf: Uint8Array): void {
buf.fill(0);
}