-
Notifications
You must be signed in to change notification settings - Fork 304
Draft Specification for V2
Yoshiyuki Mineo edited this page Oct 14, 2024
·
1 revision
- Make bit assignment customizable
- BitLenMachineID = 63 - BitLenTime - BitLenSequence
type Settings struct {
BitLenTime int
BitLenSequence int
StartTime time.Time
MachineID func() (int, error)
CheckMachineID func(int) bool
}
- Remove
NewSonyflake
- Use
New
instead
- Use
func New(st Settings) (*Sonyflake, error)
func NewSonyflake(st Settings) *Sonyflake
-
NextID
returnsint64
instead ofuint64
func (sf *Sonyflake) NextID() (int64, error)