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

feat: handle 32bit UUIDs #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

const UUID16StringLength = 4
const UUID32StringLength = 8
const UUID128StringLength = 36

// UUID is a 16-bit or 128-bit UUID.
Expand Down Expand Up @@ -90,6 +91,9 @@ func ParseUUID(s string) (UUID, error) {
switch len(s) {
case UUID16StringLength:
return ParseUUID16(s)
case UUID32StringLength:
converted := fmt.Sprintf("%s-0000-1000-8000-00805F9B34FB", s)
return ParseUUID128(converted)
case UUID128StringLength:
return ParseUUID128(s)
default:
Expand Down