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

First commit, basic prototype. #1

Closed
wants to merge 8 commits into from
Closed

First commit, basic prototype. #1

wants to merge 8 commits into from

Conversation

nurked
Copy link
Collaborator

@nurked nurked commented Jul 14, 2021

This is a basic concept of UUIDv7. Currently, it can marshal an object from byte array and return all fields of UUIDv7 as per https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/.

Tests are there to ensure that all bytes are in a correct position and can be converted to the value fields.

Next up - generating a new UUIDv7

uuid.go Outdated
return tmp
}

func (u UUIDv7) Subseq() uint64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

this and SubsecA etc should go away, because you don't know exaclty where these are

uuid.go Outdated
return UUIDv8(utmp), err
}

func (u UUIDv7) UnixTS() uint64 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this, you want a method like Time(bits int) time.Time

@nurked nurked closed this Jul 16, 2021
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.

2 participants