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

Go V3 UUIDs do not match Python V3 #21

Open
evanh opened this issue Aug 7, 2014 · 1 comment
Open

Go V3 UUIDs do not match Python V3 #21

evanh opened this issue Aug 7, 2014 · 1 comment

Comments

@evanh
Copy link

evanh commented Aug 7, 2014

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?

@satori
Copy link

satori commented Aug 18, 2014

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

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

No branches or pull requests

2 participants