improve snowflake number generating for package guid

This commit is contained in:
Jack
2020-10-30 12:40:35 +08:00
parent a7a70636dd
commit 557d2967fa

View File

@ -37,7 +37,7 @@ func init() {
if err != nil {
panic(err)
}
MachineId = uint16(ip[2])<<8 + uint16(ip[3])
MachineId = uint16(ip[2])<<8 | uint16(ip[3])
}
// I creates and returns an uint64 id which using improved SnowFlake algorithm.