8 releases

0.2.0 Nov 5, 2023
0.1.2 Oct 21, 2023
0.0.6 Oct 2, 2023
0.0.3 Sep 16, 2023

#1107 in Encoding

Download history 4/week @ 2024-02-26 9/week @ 2024-03-11 36/week @ 2024-04-01 203/week @ 2024-04-15

239 downloads per month

MIT license

24KB
632 lines

tsid

TSID generator for rust, this library is reimplementation of java tsid-creator created by Fabio Lima

example workflow

Goals:

  • Generate TSID with simple, naive implementation
  • Add basic tests to check compatibility
  • Benchmarks (compare the speed to java library)
  • Publish first usable version to crates.io
  • GitHub actions workflow to CI
  • Serde serialization
  • Thread safety

Rust GitHub Actions

How to use it?

use tsid::create_tsid;

let tsid = create_tsid()

Crate features:

  • display - add Display trait to TSID
  • debug - adds debug trait to TSID
  • serde - adds serde dependency and serialization/deserialization
  • serde_as_string - tells serde to serialize TSID as string (disabling this feature means that serde will serialize to string for human readable formats ant tu u64 otherwise)
  • bson - adds From bson conversion
  • bson_as_string - the same as for serde

Dependencies

~0.7–2.6MB
~50K SLoC