{"id":19942350,"url":"https://github.com/bahlo/sonyflake-rs","last_synced_at":"2025-04-08T02:37:34.545Z","repository":{"id":43284311,"uuid":"324358999","full_name":"bahlo/sonyflake-rs","owner":"bahlo","description":"🃏 A distributed unique ID generator inspired by Twitter's Snowflake.","archived":false,"fork":false,"pushed_at":"2024-10-09T08:53:53.000Z","size":85,"stargazers_count":179,"open_issues_count":2,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-01T01:37:40.504Z","etag":null,"topics":["rust","snowflake","sonyflake","unique-id"],"latest_commit_sha":null,"homepage":"https://docs.rs/sonyflake/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bahlo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"bahlo"}},"created_at":"2020-12-25T12:33:57.000Z","updated_at":"2025-03-25T13:51:55.000Z","dependencies_parsed_at":"2024-11-13T00:12:59.211Z","dependency_job_id":"f4a77908-1efe-45f7-ba8d-c73051d50b1b","html_url":"https://github.com/bahlo/sonyflake-rs","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":0.03389830508474578,"last_synced_commit":"635b41222e749c71bb7f49782efca737199f8b62"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahlo%2Fsonyflake-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahlo%2Fsonyflake-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahlo%2Fsonyflake-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahlo%2Fsonyflake-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahlo","download_url":"https://codeload.github.com/bahlo/sonyflake-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247766088,"owners_count":20992409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","snowflake","sonyflake","unique-id"],"created_at":"2024-11-13T00:12:40.580Z","updated_at":"2025-04-08T02:37:34.501Z","avatar_url":"https://github.com/bahlo.png","language":"Rust","funding_links":["https://github.com/sponsors/bahlo"],"categories":[],"sub_categories":[],"readme":"# sonyflake-rs\n\n[![Build](https://github.com/bahlo/sonyflake-rs/workflows/Build/badge.svg)](https://github.com/bahlo/sonyflake-rs/actions?query=workflow%3ABuild)\n[![crates.io](https://img.shields.io/crates/v/sonyflake.svg)](https://crates.io/crates/sonyflake)\n[![docs.rs](https://docs.rs/sonyflake/badge.svg)](https://docs.rs/sonyflake/)\n[![License](https://img.shields.io/crates/l/sonyflake)](LICENSE-APACHE)\n\nA distributed unique ID generator inspired by [Twitter's Snowflake](https://blog.twitter.com/2010/announcing-snowflake).\n\nThis is a Rust implementation of the original [sony/sonyflake](https://github.com/sony/sonyflake), which is written in Go.\n\nA Sonyflake ID is composed of\n\n- 39 bits for time in units of 10 msec\n- 8 bits for a sequence number\n- 16 bits for a machine id\n\n## Install\n\nAdd the following to your `Cargo.toml`:\n```toml\n[dependencies]\nsonyflake = \"0.3\"\n```\n\n## Quickstart\n\n```rust\nuse sonyflake::Sonyflake;\n\nlet sf = Sonyflake::new().unwrap();\nlet next_id = sf.next_id().unwrap();\nprintln!(\"{}\", next_id);\n```\n\n## Benchmarks\n\nBenchmarks were run on a MacBook Pro (15-inch, 2017) with a 2,8GHz i7 and 16 GB memory.\nRun them yourself with `cargo bench`.\n\n```benchmark\ntest bench_decompose ... bench:       1,066 ns/iter (+/- 132)\ntest bench_new       ... bench:     738,129 ns/iter (+/- 318,192)\ntest bench_next_id   ... bench:      37,390 ns/iter (+/- 499)\n```\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahlo%2Fsonyflake-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahlo%2Fsonyflake-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahlo%2Fsonyflake-rs/lists"}