MCPcopy Create free account
hub / github.com/datastax/cql-proxy / nameBasedUUID

Function nameBasedUUID

proxy/proxy.go:1018–1031  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

1016}
1017
1018func nameBasedUUID(name string) primitive.UUID {
1019 var uuid primitive.UUID
1020 m := crypto.MD5.New()
1021 _, _ = io.WriteString(m, name)
1022 hash := m.Sum(nil)
1023 for i := 0; i < len(uuid); i++ {
1024 uuid[i] = hash[i]
1025 }
1026 uuid[6] &= 0x0F
1027 uuid[6] |= 0x30
1028 uuid[8] &= 0x3F
1029 uuid[8] |= 0x80
1030 return uuid
1031}
1032
1033func compareIPAddr(a *net.IPAddr, b *net.IPAddr) int {
1034 if a == b {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected