You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

getrandom

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getrandom - cargo Package Compare versions

Comparing version
0.3.2
to
0.3.3
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "3a9172299b5c36791c60d3037355d5dec5fce439"
"sha1": "82396406b28f23ba86e3e511d34a4f5dab0fda08"
},
"path_in_vcs": ""
}

@@ -19,5 +19,5 @@ # This file is automatically @generated by Cargo.

name = "cc"
version = "1.2.16"
version = "1.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c"
checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0"
dependencies = [

@@ -35,9 +35,9 @@ "shlex",

name = "compiler_builtins"
version = "0.1.151"
version = "0.1.157"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abc30f1766d387c35f2405e586d3e7a88230dc728ff78cd1d0bc59ae0b63154b"
checksum = "74f103f5a97b25e3ed7134dee586e90bbb0496b33ba41816f0e7274e5bb73b50"
[[package]]
name = "getrandom"
version = "0.3.2"
version = "0.3.3"
dependencies = [

@@ -67,11 +67,11 @@ "cfg-if",

name = "libc"
version = "0.2.170"
version = "0.2.171"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828"
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
[[package]]
name = "log"
version = "0.4.26"
version = "0.4.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"

@@ -90,11 +90,11 @@ [[package]]

name = "once_cell"
version = "1.21.0"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "proc-macro2"
version = "1.0.94"
version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
dependencies = [

@@ -106,5 +106,5 @@ "unicode-ident",

name = "quote"
version = "1.0.39"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801"
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
dependencies = [

@@ -143,5 +143,5 @@ "proc-macro2",

name = "syn"
version = "2.0.100"
version = "2.0.101"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
dependencies = [

@@ -148,0 +148,0 @@ "proc-macro2",

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "getrandom"
version = "0.3.2"
version = "0.3.3"
authors = ["The Rand Project Developers"]

@@ -19,0 +19,0 @@ build = "build.rs"

@@ -7,2 +7,17 @@ # Changelog

## [0.3.3] - 2025-05-09
### Changed
- Doc improvements [#632] [#634] [#635]
- Add crate version to docs.rs links used in `compile_error!`s [#639]
## Fixed
- Error handling in WASI p1 [#661]
[#632]: https://github.com/rust-random/getrandom/pull/632
[#634]: https://github.com/rust-random/getrandom/pull/634
[#635]: https://github.com/rust-random/getrandom/pull/635
[#639]: https://github.com/rust-random/getrandom/pull/639
[#661]: https://github.com/rust-random/getrandom/pull/661
## [0.3.2] - 2025-03-17

@@ -120,2 +135,8 @@

## [0.2.16] - 2025-04-22
### Added
- Cygwin support (backport of [#626]) [#654]
[#654]: https://github.com/rust-random/getrandom/pull/654
## [0.2.15] - 2024-05-06

@@ -571,5 +592,7 @@ ### Added

[0.3.3]: https://github.com/rust-random/getrandom/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/rust-random/getrandom/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/rust-random/getrandom/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/rust-random/getrandom/compare/v0.2.15...v0.3.0
[0.2.16]: https://github.com/rust-random/getrandom/compare/v0.2.15...v0.2.16
[0.2.15]: https://github.com/rust-random/getrandom/compare/v0.2.14...v0.2.15

@@ -590,3 +613,3 @@ [0.2.14]: https://github.com/rust-random/getrandom/compare/v0.2.13...v0.2.14

[0.2.1]: https://github.com/rust-random/getrandom/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/rust-random/getrandom/compare/v0.1.15...v0.2.0
[0.2.0]: https://github.com/rust-random/getrandom/compare/v0.1.16...v0.2.0
[0.1.16]: https://github.com/rust-random/getrandom/compare/v0.1.15...v0.1.16

@@ -593,0 +616,0 @@ [0.1.15]: https://github.com/rust-random/getrandom/compare/v0.1.14...v0.1.15

@@ -133,3 +133,3 @@ # getrandom: system's random number generator

To enable `getrandom`'s functionality on `wasm32-unknown-unknown` using the Web
Crypto methods [described above](#opt-in-backends) via [`wasm-bindgen`], do
Crypto methods [described above][opt-in] via [`wasm-bindgen`], do
*both* of the following:

@@ -142,3 +142,3 @@

using [`wasm-bindgen`], but otherwise enabling this feature is harmless.)
- Set `RUSTFLAGS='--cfg getrandom_backend="wasm_js"'` ([see above](#opt-in-backends)).
- Set `RUSTFLAGS='--cfg getrandom_backend="wasm_js"'` ([see above][opt-in]).

@@ -148,2 +148,5 @@ This backend supports both web browsers (main window and Web Workers)

WARNING: It is highly recommended to enable the `wasm_js` feature only for
binary crates and tests, i.e. avoid unconditionally enabling it in library crates.
### Custom backend

@@ -153,6 +156,7 @@

a non-default entropy source, then you can provide a custom implementation.
You need to enable the custom backend as described in the [configuration flags]
section. Next, you need to define an `extern` function with the following
signature:
You need to enable the custom backend as described in the
[opt-in backends][opt-in] section.
Next, you need to define an `extern` function with the following signature:
```rust

@@ -329,3 +333,3 @@ use getrandom::Error;

[GitHub Actions]: https://github.com/rust-random/getrandom/actions?query=workflow:Tests+branch:master
[GitHub Actions]: https://github.com/rust-random/getrandom/actions?query=branch:master
[Build Status]: https://github.com/rust-random/getrandom/actions/workflows/tests.yml/badge.svg?branch=master

@@ -383,2 +387,3 @@ [crates.io]: https://crates.io/crates/getrandom

[Emscripten]: https://emscripten.org
[opt-in]: #opt-in-backends

@@ -385,0 +390,0 @@ [//]: # (licenses)

@@ -34,7 +34,7 @@ //! System-specific implementations.

} else {
compile_error!(
compile_error!(concat!(
"The \"wasm_js\" backend requires the `wasm_js` feature \
for `getrandom`. For more information see: \
https://docs.rs/getrandom/#webassembly-support"
);
https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#webassembly-support"
));
}

@@ -169,3 +169,3 @@ }

} else if #[cfg(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "none")))] {
compile_error!(
compile_error!(concat!(
"The wasm32-unknown-unknown targets are not supported by default; \

@@ -175,9 +175,10 @@ you may need to enable the \"wasm_js\" configuration flag. Note \

For more information see: \
https://docs.rs/getrandom/#webassembly-support"
);
https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#webassembly-support"
));
} else {
compile_error!("target is not supported. You may need to define \
a custom backend see: \
https://docs.rs/getrandom/#custom-backends");
compile_error!(concat!(
"target is not supported. You may need to define a custom backend see: \
https://docs.rs/getrandom/", env!("CARGO_PKG_VERSION"), "/#custom-backend"
));
}
}

@@ -14,2 +14,6 @@ //! Implementation for WASI Preview 1

/// WASI p1 uses `u16` for error codes in its witx definitions:
/// https://github.com/WebAssembly/WASI/blob/38454e9e/legacy/preview1/witx/typenames.witx#L34-L39
const MAX_ERROR_CODE: i32 = u16::MAX as i32;
#[inline]

@@ -25,4 +29,6 @@ pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> {

0 => Ok(()),
code => Err(Error::from_neg_error_code(code)),
// WASI functions should return positive error codes which are smaller than `MAX_ERROR_CODE`
code if code <= MAX_ERROR_CODE => Err(Error::from_neg_error_code(-code)),
_ => Err(Error::UNEXPECTED),
}
}

Sorry, the diff of this file is not supported yet