Skip to content

Releases: StarryLab/tsid.go

v1.0.4

Choose a tag to compare

@Mr-MaxWang Mr-MaxWang released this 22 Feb 17:42
6dbabdc

Continuously fix problems and optimize algorithms

v1.0.3-beta

Choose a tag to compare

@Mr-MaxWang Mr-MaxWang released this 21 Feb 14:01
  • Added:
    • ID new func: func (id *ID) Equal(b *ID) bool
    • ID new func: func (id *ID) Bytes() []byte
  • Fixed: simple snowflake algorithm
  • Improve unit test code coverage

v1.0.2-beta

Choose a tag to compare

@Mr-MaxWang Mr-MaxWang released this 19 Feb 17:06
d33cb6b
  • Refactored data provider
  • Added unit tests to improve code coverage
  • Added:
    • func Segments(segments ...Bits) (o *Options)
  • Fixed some bugs:
    • func(id *ID)String()
    • func Make/New return value issue
    • getting environment variables error
  • Removed:
    • func DataWrap
    • DataWrapper interface

v1.0.1-beta

Choose a tag to compare

@StarryLab StarryLab released this 18 Feb 11:33
  • Reduce algorithm complexity, improve performance
    • func Make(opt Options) (b *Builder, err error)
    • func (e *Base64) Encode(id *ID) string
    • func Make(opt Options) (b *Builder, err error)
  • Add: function New to create new Builder instance.
    • func New(opt Options) (b *Builder, err error)

v1.0.0-alpha

Choose a tag to compare

@StarryLab StarryLab released this 17 Feb 11:52

FEATURES ✨

  1. The maximum 126 bits
  2. Customize the width of each bits segment
  3. Customize the sequence of bits segments
  4. Support customize encoders
  5. BASE36 is default, using the go package strconv.FormatInt
  6. An improved BASE64 encoder to encode/decode identifiers
  7. Customize the options or use the provided default settings
  8. Supports random or auto-increment identifiers. Note: auto-increment identifiers are still random and not strictly increment
  9. Provides a classic snowflake algorithm (fixed width and position), with better performance
  10. Data source types
    • Timestamps of various precision: nanosecond, millisecond, microsecond, and second
    • Various date and time values: year, month, day, week, hour, minute, second, millisecond, and the number of days and weeks in a year
    • 1 to 63 bits secure random number
    • Option value
    • Environment variables
    • Fixed value
    • Simple sequence/serial number
    • Data sources
    • Parameter by caller