All Projects → casualjim → rs-nuid

casualjim / rs-nuid

Licence: Apache-2.0 license
NATS unique identifiers

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to rs-nuid

friendly-id
Java Friendly Id for UUID
Stars: ✭ 173 (+810.53%)
Mutual labels:  uuid
SierraChartZorroPlugin
A Zorro broker API plugin for Sierra Chart, written in Win32 C++.
Stars: ✭ 22 (+15.79%)
Mutual labels:  uuid
nats-box
A container with NATS utilities
Stars: ✭ 55 (+189.47%)
Mutual labels:  nats
ulid
Universally Unique Lexicographically Sortable Identifier (ULID) in Crystal
Stars: ✭ 28 (+47.37%)
Mutual labels:  uuid
uuidgen-el
UUID generation implemented in elisp.
Stars: ✭ 44 (+131.58%)
Mutual labels:  uuid
ulid
Haskell implementation of ULIDs (Unique Lexicographically Sortable Identifiers)
Stars: ✭ 22 (+15.79%)
Mutual labels:  uuid
python-libuuid
Faster UUID generation using libuuid
Stars: ✭ 36 (+89.47%)
Mutual labels:  uuid
domain
A dependency-free package to help building a business domain layer
Stars: ✭ 33 (+73.68%)
Mutual labels:  uuid
fuse-device
Use the basic Device functions such as UUID and current localization from Fuse
Stars: ✭ 13 (-31.58%)
Mutual labels:  uuid
uuid-generator-plugin
An IntelliJ Idea plugin to generate UUID (Universally Unique Identifier), ULID (Universally Unique Lexicographically Sortable Identifier) and CUID (Collision Resistant Unique Identifier)
Stars: ✭ 30 (+57.89%)
Mutual labels:  uuid
sno
Compact, sortable and fast unique IDs with embedded metadata.
Stars: ✭ 77 (+305.26%)
Mutual labels:  uuid
graphql-nats-subscriptions
A graphql subscriptions implementation using nats and apollo's graphql-subscriptions
Stars: ✭ 27 (+42.11%)
Mutual labels:  nats
react-native-uuid-generator
UUID generator for React Native utilizing native iOS and Android UUID classes
Stars: ✭ 88 (+363.16%)
Mutual labels:  uuid
rants
An async NATS client library for the Rust programming language.
Stars: ✭ 80 (+321.05%)
Mutual labels:  nats
pure-uuid
Pure JavaScript Based Universally Unique Identifiers (UUID)
Stars: ✭ 60 (+215.79%)
Mutual labels:  uuid
python-ulid
ULID implementation for Python
Stars: ✭ 177 (+831.58%)
Mutual labels:  uuid
uuid
Go package for UUIDs based on RFC 4122 Time-Based UUID
Stars: ✭ 38 (+100%)
Mutual labels:  uuid
uid
Provides an object-oriented API to generate and represent UIDs.
Stars: ✭ 315 (+1557.89%)
Mutual labels:  uuid
go-nats-examples
Single repository for go-nats example code. This includes all documentation examples and any common message pattern examples.
Stars: ✭ 99 (+421.05%)
Mutual labels:  nats
php-uuid
RFC 4122 compliant UUID generator and parser for PHP.
Stars: ✭ 13 (-31.58%)
Mutual labels:  uuid

NUID

License Apache 2

A highly performant unique identifier generator.

Installation

In Cargo.toml:

[dependencies]
nuid = "~0.2"

Basic Usage

extern crate nuid;

// Utilize the global locked instance
nuid := nuid::next();

// Create an instance, these are not locked.
n := nuid::NUID::new();
nuid = n.next();

// Generate a new crypto/rand seeded prefix.
// Generally not needed, happens automatically.
n.randomize_prefix();

Performance

NUID needs to be very fast to generate and be truly unique, all while being entropy pool friendly. NUID uses 12 bytes of crypto generated data (entropy draining), and 10 bytes of pseudo-random sequential data that increments with a pseudo-random increment.

Total length of a NUID string is 22 bytes of base 62 ascii text, so 62^22 or 2707803647802660400290261537185326956544 possibilities.

NUID can generate identifiers as fast as 60ns, or ~16 million per second. There is an associated benchmark you can use to test performance on your own hardware.

License

Unless otherwise noted, the NATS source files are distributed under the Apache Version 2.0 license found in the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].