--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/Rn13T6BZpgE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
There seem to be a lot of UUID packages (http://godoc.org/?q=uuid).Can someone recommend a UUID package thats stable and fast?
This implementation can easily be extended so that it generates valid version 4 UUIDs (see RFC 4122, section 4.4):func uuid() string {b := make([]byte, 16)Random.Read(b)b[6] = (b[6] & 0x0f) | 0x40b[8] = (b[8] & 0x3f) | 0x80return fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])}I would recommend to use crypto/rand instead of reading /dev/urandom directly though.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.