mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-22 08:08:11 +00:00
Merge pull request #536 from Quuxplusone/numeric-limits
Stop using numeric_limits for the constant "255", and fix a bug.
This commit is contained in:
commit
70ba34d079
@ -45,7 +45,7 @@ bc::ec_secret random_secret(std::default_random_engine& engine)
|
||||
bc::ec_secret secret;
|
||||
// Iterate through every byte setting a random value...
|
||||
for (uint8_t& byte: secret)
|
||||
byte = engine() % std::numeric_limits<uint8_t>::max();
|
||||
byte = engine() & 255;
|
||||
// Return result.
|
||||
return secret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user