const tsLen … const cntLen … const suffixLen … type Generator … func NewGenerator(memberID uint16, now time.Time) *Generator { … } // Next generates a id that is unique. func (g *Generator) Next() uint64 { … } func lowbit(x uint64, n uint) uint64 { … }