Skip to content
@nanoflakes

nanoflakes

little tiny snowflakes

Nanoflakes Logo

Nanoflakes

"Nanoflakes" is a specification for unique identifiers which can be generated locally or from a remote server. The specification is designed to be simple and easy to implement, and to be compatible with Twitter's Snowflake algorithm, which Nanoflakes is based on.

What's a Nanoflake?

A nanoflake is a 64-bit signed integer, and supports 1024 unique ID generators, each being able to generate 4096 (2^12) unique IDs per millisecond, and with 41-bit timestamps.

The main and only difference between a nanoflake and a Twitter Snowflake is that nanoflakes merges Twitter's 5-bit datacenter ID and 5-bit worker ID into a single 10-bit generator ID.

Additionally, the specification suggests encoding nanoflakes using base-36, in order to fit the largest possible nanoflake into a 13-character string.

The official, full specification can be found here.

Implementations

Nanoflakes have reference implementations in the following languages:

You're more than welcome to implement nanoflakes in other languages! If you do, please open a pull request to add your implementation to this list.

License

The official Nanoflakes specification is licensed under the CCO 1.0 Universal license.

The reference implementations are licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or pull request to suggest changes to the specification or to add a new implementation.

Popular repositories Loading

  1. .github .github Public

    GitHub repository for the Nanoflakes project.

    3

  2. nanoflakes-java nanoflakes-java Public

    Reference implementation of nanoflakes for Java.

    Java 3

  3. spec spec Public

    Official specification of the Nanoflakes identifier format.

    1 1

  4. nanoflakes-kotlin nanoflakes-kotlin Public

    Reference implementation of nanoflakes for Kotlin.

    Kotlin 1

  5. nanoflakes-js nanoflakes-js Public

    Reference implementation of nanoflakes for JavaScript.

    TypeScript

  6. nanoflakes-go nanoflakes-go Public

    Reference implementation of nanoflakes for Go.

    1

Repositories

Showing 6 of 6 repositories
  • nanoflakes-go Public

    Reference implementation of nanoflakes for Go.

    nanoflakes/nanoflakes-go’s past year of commit activity
    0 MIT 1 0 1 Updated Jan 17, 2023
  • nanoflakes-kotlin Public

    Reference implementation of nanoflakes for Kotlin.

    nanoflakes/nanoflakes-kotlin’s past year of commit activity
    Kotlin 0 MIT 1 1 1 Updated Oct 16, 2022
  • spec Public

    Official specification of the Nanoflakes identifier format.

    nanoflakes/spec’s past year of commit activity
    1 CC0-1.0 1 3 (1 issue needs help) 0 Updated Oct 10, 2022
  • nanoflakes-java Public

    Reference implementation of nanoflakes for Java.

    nanoflakes/nanoflakes-java’s past year of commit activity
    Java 3 MIT 0 1 0 Updated Oct 9, 2022
  • .github Public

    GitHub repository for the Nanoflakes project.

    nanoflakes/.github’s past year of commit activity
    3 CC0-1.0 0 1 0 Updated Oct 2, 2022
  • nanoflakes-js Public

    Reference implementation of nanoflakes for JavaScript.

    nanoflakes/nanoflakes-js’s past year of commit activity
    TypeScript 0 MIT 0 3 (2 issues need help) 0 Updated May 28, 2022

Top languages

Loading…

Most used topics

Loading…