开发者

Deriving a random long value from random integers

开发者 https://www.devze.com 2023-04-10 06:38 出处:网络
I have a method int randInt(int min, int max) that generates a random integer between min and max inclusive. It interfaces with an external system that has a good source of entropy.

I have a method int randInt(int min, int max) that generates a random integer between min and max inclusive. It interfaces with an external system that has a good source of entropy.

The external system only generates 32-bit integers, 开发者_StackOverflowwhile I need to get a 64-bit long.

Is it possible to compose several random integers to create a long without introducing any new bias?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号