I’m basically following the example here for a RNG:
const std = @import("std");
const expect = std.testing.expect;
// Random number generator used all over
pub fn ourRng() !std.rand.DefaultPrng {
return std.rand.DefaultPrng.init(blk: {
var seed: u64 = undefined;
try std.os.getrandom(std.mem.asBytes(&seed));
break :blk seed;
});
}
But I get the error that
error: root struct of file 'os' has no member named 'getrandom'
That’s exactly the case, but I’m a bit lost on how to use the new? stdRandom
for the same purpose. Once I get that done, I will dutifully make a PR to the documentation