Support V4 Uuids from arbitrary random bytes #170
Labels
No labels
breaking
bug
dependencies
good first issue
help wanted
unstable
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-uuid-rs/uuid#170
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Note: for support questions, please use gitter or users forums. This
repository's issues are reserved for feature requests and bug reports.
I'm submitting a ...
at the top of this template.
Description
I thought we could flesh out our solution to creating uuids using alternative
Rngs without having to makeranda public dependency.new_v4_bat_scooter_name_not_importanthttps://github.com/servo/servo/issues/20306 suggested a
new_v4_from_bytesmethod as a workaround to needing to makeranda public dependency. Following the naming convention for other constructors, it might look like:It would be nice to use
[u8; 16]as the source instead of&[u8]so we can make the method infallible. It would be a bit inconsistent to usefn new_v4_from_bytes(b: [u8; 16])since we already havefn from_bytes(b: &[u8]).new_v4_from_uuid_bytesis a bit of a nasty name. So for now it could be:We could even go ahead and name it something like
new_v4_from_rng_bytes([u8; 16])and deprecate it oncerandis stable in favour ofRand::rand.BuilderEdit: Moved to a seperate issue #171
Related to: #153
cc: @nox @kinggoesgaming @Dylan-DPC
I like this name, as it clearly gets the meaning across.
Edit: removed suggestion on using
#[unstable]attribute.As per the
BuilderI think I will give it some thought before giving any comments on it.I would use
randominstead ofrngin the name. What do you mean by#[unstable]?wait nevermind, ignore that
#[unstable]I sometimes forget thatunstableisstdspecific attributeWill give it a try today :)
Edit: Have moved Builder Pattern to a seperate issue #171
done