gouuid icon indicating copy to clipboard operation
gouuid copied to clipboard

Go V3 UUIDs do not match Python V3

Open evanh opened this issue 10 years ago • 1 comments

This is probably not an issue, but I'm trying to understand why this library would differ from the Python library.

Given the following two code segments:

Go:: package main

import "github.com/nu7hatch/gouuid" import "fmt"

func main() { c, _ := uuid.ParseHex("6ba7b810-9dad-11d1-80b4-00c04fd430c8") x, _ := uuid.NewV3(c, []byte("test")) fmt.Println(x.String()) }

Outputs: 45a113ac-c7f2-30b0-50a5-a399ab912716

Python:: import uuid c = uuid.UUID("6ba7b810-9dad-11d1-80b4-00c04fd430c8") print uuid.uuid3(c, "test")

Outputs: 45a113ac-c7f2-30b0-90a5-a399ab912716

Using Go 1.2 and Python 2.7.2

Note that the 8th byte is different, giving 90a5 instead of 50a5. Looking into this suggests that this library uses a different variant than Python. Was this a conscious decision? Are you following a different standard than them?

evanh avatar Aug 07 '14 21:08 evanh

The reason is that library is still not RFC compliant. See #5 and #6.

satori avatar Aug 18 '14 21:08 satori