Possible to seed UUID v4 random number generator? #100

Closed
opened 2017-08-05 11:09:18 -05:00 by adaszko · 2 comments
adaszko commented 2017-08-05 11:09:18 -05:00 (Migrated from github.com)

As in the title. That would be very useful for e.g. tests where determinisms highly desired.

As in the title. That would be very useful for e.g. tests where determinisms highly desired.
alexcrichton commented 2017-08-06 22:40:18 -05:00 (Migrated from github.com)

The Uuid::new_v4 constructor can't be seeded, but you can use impl Rand for Uuid to specify a custom and seeded random number generator which should work for this!

The `Uuid::new_v4` constructor can't be seeded, but you can use [`impl Rand for Uuid`](https://github.com/rust-lang-nursery/uuid/blob/master/src/lib.rs#L924-L934) to specify a custom and seeded random number generator which should work for this!
adaszko commented 2017-08-07 01:31:00 -05:00 (Migrated from github.com)

Wow, that hasn't occurred to me. Thank you Alex, I will try it out 👍

Wow, that hasn't occurred to me. Thank you Alex, I will try it out 👍
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-uuid-rs/uuid#100
No description provided.