Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add random et al to U256 and other number types #887

Closed
onbjerg opened this issue Feb 26, 2025 · 1 comment
Closed

[Feature] Add random et al to U256 and other number types #887

onbjerg opened this issue Feb 26, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@onbjerg
Copy link
Contributor

onbjerg commented Feb 26, 2025

Component

primitives

Describe the feature you would like

B256 (or rather FixedBytes) has a random and random methods: https://docs.rs/alloy/latest/alloy/primitives/struct.FixedBytes.html#method.random

Currently to generate a random U256 you need to do this (or similar):

let random: U256 = B256::random().into();

Additional context

No response

@onbjerg onbjerg added the enhancement New feature or request label Feb 26, 2025
@DaniPopes
Copy link
Member

Moved to recmo/uint#440

@DaniPopes DaniPopes closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants