package mainimport ( "fmt" uuid "github.com/satori/go.uuid")func main() { // 创建 u1 := uuid.NewV4() fmt.Printf("UUIDv4: %s\n", u1) // 解析 u2, err := uuid.FromString("f5394eef-e576-4709-9e...
func intToBytes(n int) []byte { x := int32(n) bytesBuffer := bytes.NewBuffer([]byte{}) binary.Write(bytesBuffer, binary.BigEndian, x) return bytesBuffer.Bytes()}
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号