|
|
@ -1,6 +1,7 @@ |
|
|
|
package core |
|
|
|
package core |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"crypto/md5" |
|
|
|
"encoding/hex" |
|
|
|
"encoding/hex" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
) |
|
|
|
) |
|
|
@ -8,6 +9,13 @@ import ( |
|
|
|
// The ID of en entity, in the form of an UUID.
|
|
|
|
// The ID of en entity, in the form of an UUID.
|
|
|
|
type VID [16]byte |
|
|
|
type VID [16]byte |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (v VID) Hash(suffix []byte) []byte { |
|
|
|
|
|
|
|
md5 := md5.New() |
|
|
|
|
|
|
|
md5.Write(v[:]) |
|
|
|
|
|
|
|
md5.Write(suffix) |
|
|
|
|
|
|
|
return md5.Sum(nil) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var byteGroups = []int{8, 4, 4, 4, 12} |
|
|
|
var byteGroups = []int{8, 4, 4, 4, 12} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: leverage a full functional UUID library
|
|
|
|
// TODO: leverage a full functional UUID library
|
|
|
|