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

@@ -842,7 +842,7 @@ pub const CommandLineReporter = struct {
// Write the lcov.info file to a temporary file we atomically rename to the final name after it succeeds
var base64_bytes: [8]u8 = undefined;
var shortname_buf: [512]u8 = undefined;
bun.rand(&base64_bytes);
bun.csprng(&base64_bytes);
const tmpname = std.fmt.bufPrintZ(&shortname_buf, ".lcov.info.{s}.tmp", .{std.fmt.fmtSliceHexLower(&base64_bytes)}) catch unreachable;
const path = bun.path.joinAbsStringBufZ(relative_dir, &lcov_name_buf, &.{ opts.reports_directory, tmpname }, .auto);
const file = bun.sys.File.openat(