Skip to content

Commit

Permalink
Fix web crypto usage to work in node etc (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
taybenlor committed Oct 11, 2023
1 parent 5fe65f4 commit d2689bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/wasi/lib/wasi/wasi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export class WASI implements SnapshotPreview1 {
*/
random_get(buffer_ptr: number, buffer_len: number): number {
const buffer = new Uint8Array(this.memory.buffer, buffer_ptr, buffer_len);
crypto.getRandomValues(buffer);
globalThis.crypto.getRandomValues(buffer);
return Result.SUCCESS;
}

Expand Down

0 comments on commit d2689bd

Please sign in to comment.