Skip to content

Instantly share code, notes, and snippets.

View michielboekhoff's full-sized avatar

Michiel Boekhoff michielboekhoff

  • Self-employed
  • Nottingham
View GitHub Profile
@jen20
jen20 / wtf.go
Last active October 14, 2019 12:28
var order = [...]int{3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15}
func wtfToUUID(netEncoded []byte) uuid.UUID {
uuidBytes := make([]byte, 16)
for i := 0; i < len(order); i++ {
uuidBytes[i] = netEncoded[order[i]]
}
return uuidBytes
}