Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 55 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "uuid-utils"
version = "0.10.0"
version = "0.11.0"
edition = "2021"

[lib]
name = "uuid_utils"
crate-type = ["cdylib"]

[dependencies]
mac_address = "1.1.7"
pyo3 = { version = "0.23.1", features = ["extension-module", "generate-import-lib", 'abi3-py39'] }
rand = "0.8.5"
uuid = { version = "1.11.0", features = ["v1", "v3", "v4", "v5", "v6", "v7", "v8", "fast-rng"]}
mac_address = "1.1.8"
pyo3 = { version = "0.25.0", features = ["extension-module", "generate-import-lib", 'abi3-py39'] }
rand = "0.9.1"
uuid = { version = "1.16.0", features = ["v1", "v3", "v4", "v5", "v6", "v7", "v8", "fast-rng"]}
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
Python UUID implementation using Rust's UUID library.
This will make `uuid4` function around 10x faster.

This package can be a drop-in replacement to the standard library UUID
which implements existing UUID versions like v4 in Rust
and also adds draft UUID versions like v6.
This package can be a drop-in replacement to the standard library UUID.

Avaialble UUID versions:

Expand All @@ -28,8 +26,6 @@ Avaialble UUID versions:
- `uuid7` - Version 7 UUIDs using a Unix timestamp ordered by time.
- `uuid8` - Version 8 UUIDs using user-defined data.

<sup>Please note that UUID versions 6, 7 and 8 are still in draft RFC.</sup><br>

## Installation
Using `pip`:
```shell
Expand Down
6 changes: 0 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
Python UUID implementation using Rust's UUID library.
This will make `uuid4` function around 10x faster.

This package can be a drop-in replacement to the standard library UUID
which implements existing UUID versions like v4 in Rust
and also adds draft UUID versions like v6.

Avaialble UUID versions:

- `uuid1` - Version 1 UUIDs using a timestamp and monotonic counter.
Expand All @@ -28,8 +24,6 @@ Avaialble UUID versions:
- `uuid7` - Version 7 UUIDs using a Unix timestamp ordered by time.
- `uuid8` - Version 8 UUIDs using user-defined data.

<sup>Please note that UUID versions 6, 7 and 8 are still in draft RFC.</sup><br>

## Installation
Using `pip`:
```shell
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "uuid_utils"
description = "Drop-in replacement for Python UUID in Rust"
description = "Drop-in replacement for Python UUID with bindings in Rust"
authors = [{ name = "Amin Alaee", email = "me@aminalaee.dev" }]
keywords = ["rust", "uuid"]
requires-python = ">=3.9"
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ fn _getnode() -> u64 {
Ok(Some(mac_address)) => mac_address.bytes(),
_ => {
let mut bytes = [0u8; 6];
rand::thread_rng().fill_bytes(&mut bytes);
rand::rng().fill_bytes(&mut bytes);
bytes[0] = bytes[0] | 0x01;
bytes
}
Expand Down