Closed nskinkel closed 9 years ago
After a bit of research and playing around, it seems like this will actually be a little icky to do correctly.
Some initial options:
mut
(which OsRng
requires) or if this is even possibleAs I learn more about Rust static
variables, there's another wrinkle here: static
variables can't implement the Drop
trait...which OsRng
does :(
randombytes()
currently does something like:We should figure out a way to avoid creating a new instance on every call, ideally just do it once on the first
randombytes()
invocation.