From a5fcee8c38af27d2ec6e49b103a591f4a709f7e3 Mon Sep 17 00:00:00 2001 From: gkuchta Date: Tue, 9 Mar 2021 01:03:41 -0600 Subject: [PATCH] feat: handle 32bit UUIDs --- core.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core.go b/core.go index 2c154db..7f23ceb 100644 --- a/core.go +++ b/core.go @@ -8,6 +8,7 @@ import ( ) const UUID16StringLength = 4 +const UUID32StringLength = 8 const UUID128StringLength = 36 // UUID is a 16-bit or 128-bit UUID. @@ -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: