diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3d769c0..e797907 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub-cli" -version = "0.0.7" +version = "0.0.9" description = """ A cross-platform CLI tool written in Rust to sign Nanopublications. """ @@ -14,6 +14,6 @@ homepage.workspace = true categories.workspace = true [dependencies] -nanopub = { version = "0.0.7", path = "../lib" } +nanopub = { version = "0.0.9", path = "../lib" } clap = { version = "4.4", features = ["derive"] } tokio = { version = "1.34", features = ["macros", "rt-multi-thread"] } diff --git a/js/Cargo.toml b/js/Cargo.toml index a853faa..6f7b1ed 100644 --- a/js/Cargo.toml +++ b/js/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub-js" -version = "0.0.7" +version = "0.0.9" description = "JavaScript bindings for the Nanopub rust toolkit" repository = "https://github.com/vemonet/nanopub-rs/tree/main/js" authors.workspace = true @@ -15,7 +15,7 @@ categories.workspace = true crate-type = ["cdylib"] [dependencies] -nanopub = { version = "0.0.7", path = "../lib" } +nanopub = { version = "0.0.9", path = "../lib" } wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" js-sys = "0.3" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index d98e90e..f6ec096 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub" -version = "0.0.7" +version = "0.0.9" description = """ A cross-platform Rust library to sign Nanopublications, with bindings to Python and JS (wasm) """ diff --git a/lib/src/utils.rs b/lib/src/utils.rs index cd44abd..42fa1c9 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -83,10 +83,9 @@ pub fn get_np_server(random: bool) -> &'static str { return LIST_SERVERS[0]; } // Generate a random number - let mut buf = [0u8; 4]; // Buffer to store 4 bytes (u32) + let mut buf = [0u8; 4]; getrandom(&mut buf).expect("Failed to generate random number"); - let num = u32::from_ne_bytes(buf); // Convert bytes to u32 - // Use the random number to generate an index + let num = u32::from_ne_bytes(buf); let index = num as usize % LIST_SERVERS.len(); LIST_SERVERS[index] } diff --git a/python/Cargo.toml b/python/Cargo.toml index 900e8bd..17267f5 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nanopub-sign" -version = "0.0.7" +version = "0.0.9" description = "Python bindings for the Nanopub rust toolkit" repository = "https://github.com/vemonet/nanopub-rs/tree/main/python" authors.workspace = true @@ -16,7 +16,7 @@ name = "nanopub_sign" crate-type = ["cdylib"] [dependencies] -nanopub = { version = "0.0.7", path = "../lib" } +nanopub = { version = "0.0.9", path = "../lib" } pyo3 = { version = "0.20", features = ["extension-module"] } pyo3-asyncio = "0.20" tokio = { version = "1.34", features = ["rt-multi-thread"] }