tsid

Crates.iotsid
lib.rstsid
version0.3.1
sourcesrc
created_at2023-09-16 00:40:26.752055
updated_at2024-08-06 19:30:00.897583
descriptionA Rust library for generating Time-Sorted Unique Identifiers
homepage
repositoryhttps://github.com/jakudlaty/tsid/
max_upload_size
id974044
size28,599
Maciej Stępyra (jakudlaty)

documentation

https://docs.rs/tsid/

README

tsid

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

example workflow

Implementation status:

  • 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;

fn main() {
    let tsid = create_tsid();
}

Crate features:

  • bson_as_string - the same as for serde
  • bson - adds From bson conversion
  • chrono - Allow extracting DateTime from TDIS
  • debug - adds debug trait to TSID
  • display - add Display trait to TSID
  • 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)
  • serde - adds serde dependency and serialization/deserialization
Commit count: 58

cargo fmt