Re: [PATCH 1/6] maintenance: add get_random_minute()
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Aug 9, 2023, 20:34 UTC
- Message-ID
- <ZNP4b8/QF73F3ySU@nand.local>
- In-Reply-To
- <xmqq7cq4nj7l.fsf@gitster.g>
On Wed, Aug 09, 2023 at 11:50:38AM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> Derrick Stolee <derrickstolee@github.com> writes: > > >> Instead of using srand() and rand() (which would make sense to wrap with > >> git_rand() as you propose), we can simplify our lives by using a CSPRNG, > >> which only gets initialized once, as is already the case with > >> csprng_bytes(). > > > > So the idea is to use csprng_bytes() everywhere instead of srand()/rand(). > > > > I can adjust my local patch to still create git_rand(), but base it on > > csprng_bytes() and not collide with your patch. Mimicking rand()'s behavior > > is a simpler interface to consume. > > I am still ambivalent about wasting entropy for something that > srand() would suffice, so git_rand() interface may be an welcome > addition anyway, that serves an extra layer of indirection to > insulate the callers from the implementation.
Sounds good to me, I'm not particularly attached to one implementation over another. Thanks, both.
Thanks, Taylor