-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support V4 Uuids from arbitrary random bytes #170
Comments
I like this name, as it clearly gets the meaning across. Edit: removed suggestion on using As per the |
I would use |
wait nevermind, ignore that |
Will give it a try today :) Edit: Have moved Builder Pattern to a seperate issue #171 |
172: from_rng_bytes added r=Dylan-DPC a=Dylan-DPC <!-- As we are working towards a stable version of uuid, we require that you open an issue, before submitting a pull request. If the pull request is imcomplete, prepend the Title with WIP: --> **I'm submitting a ...** - [ ] bug fix - [x] feature enhancement - [ ] deprecation or removal - [ ] refactor # Description <!-- Provide a summary of your changes in the Title above --> As discussed in the issue, this method is a solution to avoid making `rand` a public dependency # Motivation To avoid making `rand` public dependency <!-- Why is this change required --> # Tests <!-- How are these changes tested? --> none, test added # Related Issue(s) #170 <!-- As noted above, we require an issue for every PR. Please link to the issue here -->
172: from_rng_bytes added r=kinggoesgaming a=Dylan-DPC <!-- As we are working towards a stable version of uuid, we require that you open an issue, before submitting a pull request. If the pull request is imcomplete, prepend the Title with WIP: --> **I'm submitting a ...** - [ ] bug fix - [x] feature enhancement - [ ] deprecation or removal - [ ] refactor # Description <!-- Provide a summary of your changes in the Title above --> As discussed in the issue, this method is a solution to avoid making `rand` a public dependency # Motivation To avoid making `rand` public dependency <!-- Why is this change required --> # Tests <!-- How are these changes tested? --> none, test added # Related Issue(s) #170 <!-- As noted above, we require an issue for every PR. Please link to the issue here -->
done |
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
Rng
s without having to makerand
a public dependency.new_v4_bat_scooter_name_not_important
servo/servo#20306 suggested a
new_v4_from_bytes
method as a workaround to needing to makerand
a 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_bytes
is 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 oncerand
is stable in favour ofRand::rand
.Builder
Edit: Moved to a seperate issue #171
Related to: #153
cc: @nox @kinggoesgaming @Dylan-DPC
The text was updated successfully, but these errors were encountered: