diff --git a/Cargo.lock b/Cargo.lock index 9e1ddc6..43af4eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "atomic" @@ -55,9 +55,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cfg_aliases" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "crypto-common" @@ -91,12 +91,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", "libc", + "r-efi", "wasi", ] @@ -114,15 +115,15 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" [[package]] name = "libc" -version = "0.2.154" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "mac_address" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8836fae9d0d4be2c8b4efcdd79e828a2faa058a90d005abf42f91cac5493a08e" +checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" dependencies = [ "nix", "winapi", @@ -149,9 +150,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ "bitflags", "cfg-if", @@ -189,11 +190,10 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebb0c0cc0de9678e53be9ccf8a2ab53045e6e3a8be03393ceccc5e7396ccb40" +checksum = "f239d656363bcee73afef85277f1b281e8ac6212a1d42aa90e55b90ed43c47a4" dependencies = [ - "cfg-if", "indoc", "libc", "memoffset", @@ -207,9 +207,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e3ce69c4ec34476534b490e412b871ba03a82e35604c3dfb95fcb6bfb60c09" +checksum = "755ea671a1c34044fa165247aaf6f419ca39caa6003aee791a0df2713d8f1b6d" dependencies = [ "once_cell", "python3-dll-a", @@ -218,9 +218,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09f311c76b36dfd6dd6f7fa6f9f18e7e46a1c937110d283e80b12ba2468a75" +checksum = "fc95a2e67091e44791d4ea300ff744be5293f394f1bafd9f78c080814d35956e" dependencies = [ "libc", "pyo3-build-config", @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4f74086536d1e1deaff99ec0387481fb3325c82e4e48be0e75ab3d3fcb487a" +checksum = "a179641d1b93920829a62f15e87c0ed791b6c8db2271ba0fd7c2686090510214" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -240,9 +240,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e77dfeb76b32bbf069144a5ea0a36176ab59c8db9ce28732d0f06f096bbfbc8" +checksum = "9dff85ebcaab8c441b0e3f7ae40a6963ecea8a9f5e74f647e33fcf5ec9a1e89e" dependencies = [ "heck", "proc-macro2", @@ -253,9 +253,9 @@ dependencies = [ [[package]] name = "python3-dll-a" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f07cd4412be8fa09a721d40007c483981bbe072cd6a21f2e83e04ec8f8343f" +checksum = "49fe4227a288cf9493942ad0220ea3f185f4d1f2a14f197f7344d6d02f4ed4ed" dependencies = [ "cc", ] @@ -269,22 +269,27 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "rand" -version = "0.8.5" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ - "libc", "rand_chacha", "rand_core", ] [[package]] name = "rand_chacha" -version = "0.3.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", "rand_core", @@ -292,9 +297,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom", ] @@ -318,9 +323,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "typenum" @@ -342,9 +347,9 @@ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" [[package]] name = "uuid" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ "atomic", "getrandom", @@ -355,7 +360,7 @@ dependencies = [ [[package]] name = "uuid-utils" -version = "0.10.0" +version = "0.11.0" dependencies = [ "mac_address", "pyo3", @@ -371,9 +376,12 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] [[package]] name = "winapi" @@ -396,3 +404,12 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] diff --git a/Cargo.toml b/Cargo.toml index a53657b..0d9f9ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "uuid-utils" -version = "0.10.0" +version = "0.11.0" edition = "2021" [lib] @@ -8,7 +8,7 @@ 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"]} diff --git a/README.md b/README.md index 0a7631e..ded1319 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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. -Please note that UUID versions 6, 7 and 8 are still in draft RFC.
- ## Installation Using `pip`: ```shell diff --git a/docs/index.md b/docs/index.md index 0a7631e..872bb92 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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. @@ -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. -Please note that UUID versions 6, 7 and 8 are still in draft RFC.
- ## Installation Using `pip`: ```shell diff --git a/pyproject.toml b/pyproject.toml index c6aea54..49bdd83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/lib.rs b/src/lib.rs index bd6538f..f4c4d71 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 }