An open API service indexing awesome lists of open source software.

https://github.com/kkent030315/timeflake-rs

Rust port of Timeflake, a 128-bit, roughly-ordered, URL-safe UUID.
https://github.com/kkent030315/timeflake-rs

Last synced: 5 months ago
JSON representation

Rust port of Timeflake, a 128-bit, roughly-ordered, URL-safe UUID.

Awesome Lists containing this project

README

          

[![Actions][actions-badge]][actions-url]
[![crates.io version][crates-timeflake-badge]][crates-timeflake]

[actions-badge]: https://github.com/kkent030315/timeflake/workflows/CI/badge.svg?branch=master
[actions-url]: https://github.com/kkent030315/timeflake/actions
[crates-timeflake-badge]: https://img.shields.io/crates/v/timeflake.svg
[crates-timeflake]: https://crates.io/crates/timeflake

# timeflake-rs

Rust port of Timeflake, a 128-bit, roughly-ordered, URL-safe UUID.

Original work can be found at [anthonynsimon/timeflake](https://github.com/anthonynsimon/timeflake).

## Usage

```toml
[dependencies]
timeflake = "0.1.0"
```

or

```bash
cargo add timeflake
```

## Example

```rust
use timeflake::Timeflake;

fn main() {
let mut rng = rand::rng();
let flake = Timeflake::new_random(&mut rng);
println!("{flake}");
}
```

## Features

- `std`: Allow `no_std` environments. This is on by default.
- `uuid`: Allow use of `uuid` crate. This is on by default.

## Benchmark

Run benchmarks by follow command. It is recommended to have gnuplot installed.

```bash
cargo bench
```