Skip to content
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

add uuid version 6 and 7 #139

Merged
merged 2 commits into from Nov 23, 2023
Merged

add uuid version 6 and 7 #139

merged 2 commits into from Nov 23, 2023

Conversation

it512
Copy link
Contributor

@it512 it512 commented Nov 15, 2023

@it512 it512 requested a review from a team as a code owner November 15, 2023 15:35
@it512
Copy link
Contributor Author

it512 commented Nov 15, 2023

@bormanp

time.go Outdated
@@ -108,12 +108,23 @@ func setClockSequence(seq int) {
}

// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
// uuid. The time is only defined for version 1 and 2 UUIDs.
// uuid. The time is only defined for version 1, 2 and 6, 7 UUIDs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1, 2, 6 and 7.

version7.go Outdated
}

// NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch).
// it use NewRandomFromReader fill random bits, if error, NewV7FromReader returns Nil and an error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// On error, NewV7FromReader returns Nil and an error.

version7.go Outdated
//
// NewV7 returns a Version 7 UUID based on the current time(Unix Epoch).
// Uses the randomness pool if it was enabled with EnableRandPool.
// NewV7 use NewRandom fill random bits, if error, NewV7 returns Nil and an error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to specify the internal implementation. Line 22 should be:

// On error, NewV7 returns Nil and an error.

@it512
Copy link
Contributor Author

it512 commented Nov 21, 2023

ok fix it. Thank you!
@bormanp

@bormanp bormanp merged commit b35aa6a into google:master Nov 23, 2023
5 of 6 checks passed
@bensie bensie mentioned this pull request Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants