smol-rs / fastrand

A simple and fast random number generator
Apache License 2.0
386 stars 33 forks source link

How to generate random number 58 bit length ? #67

Closed Manosuper closed 1 year ago

Manosuper commented 1 year ago

Subj.

Thank you for your answer.

Thank you for your REALLY FAST GENERATOR !

notgull commented 1 year ago

If I'm remembering my bit math correctly...

fastrand::u64(..) & ((1 << 59) - 1)

What is the application? I'm curious.

Hurd8x commented 1 year ago

Mister, thank you very mach for your fast answer.

I use version of fastrng fo Python

https://github.com/lemire/fastrand

How I can use fast rng to generate 58 bit random in Python ?

Thank You

notgull commented 1 year ago

The fastrand Python package is unrelated to this crate