Password.random_bytes: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/src/crypto/password.bend as Password Lines 90-99 of bend-collections-laws-crypto@1.0.0.0/src/crypto/password.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/src/crypto/password.bend&start_line=90&end_line=99 import Base # n bytes from the operating system's generator. def random_bytes(n: Nat) -> IO(List<&2, U32>): match n: case 0n: IO.pure(List<&2, U32>, Nil{}) case 1n+k: do IO>: w : U32 <- IO.try(U32, IO.random_u32()) rest : List<&2, U32> <- random_bytes(k) return U32.and(w, 255) <> rest Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.random_u32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.try https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and