// New returns a new flake id generator configured with the bucket id.
New returns a new flake id generator configured with the bucket id.
// New returns a new flake id generator configured with the bucket id .
func New(bucketID uint64) (Generator, error) {
	if bucketID > BucketLimit {
		return nil, fmt.Errorf("bucket id must be between 0 and %d: %d provided", BucketLimit, bucketID)
	}
	return &generator{
		bucketID:         bucketID,
		currentTimestamp: now(),
		currentSequence:  uint64(0),
	}, nil
}
func New ( bucketID uint64 ) ( Generator , error ) { if bucketID > BucketLimit { return nil , fmt . Errorf ( " " , BucketLimit , bucketID ) } return & generator { bucketID : bucketID , currentTimestamp : now ( ) , currentSequence : uint64 ( 0 ) , } , nil }
New returns a new flake id generator configured with the bucket id.
New returns a new flake id generator configured with the bucket id .