You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
funcmain() {
// Create a new Node with a Node number of 1node, err:=snowflake.NewNode(1)
iferr!=nil {
fmt.Println(err)
return
}
// Generate a snowflake ID.id:=node.Generate()
// Print out the ID in a few different ways.fmt.Println(id)
fmt.Println(id.Base64())
b:=id.IntBytes()
fmt.Println(base64.StdEncoding.EncodeToString(b[:]))
}
result:
dig into souce, i found that base64 method use string representation of int64 for encoding, which make no sense:
it only make representation much longer.
The text was updated successfully, but these errors were encountered: