crypto: fix test-crypto-random.js (#18044)

Co-authored-by: Meghan Denny <meghan@bun.sh>
This commit is contained in:
Dylan Conway
2025-03-11 18:21:20 -07:00
committed by GitHub
parent 6d0739f7d9
commit ddfc8555f7
28 changed files with 1030 additions and 178 deletions

View File

@@ -1387,7 +1387,7 @@ pub const PostgresSQLConnection = struct {
pub fn nonce(this: *SASL) []const u8 {
if (this.nonce_len == 0) {
var bytes: [nonce_byte_len]u8 = .{0} ** nonce_byte_len;
bun.rand(&bytes);
bun.csprng(&bytes);
this.nonce_len = @intCast(bun.base64.encode(&this.nonce_base64_bytes, &bytes));
}
return this.nonce_base64_bytes[0..this.nonce_len];