pow: Fix off-by-one error

Length check has an off-by-one error in it, we want the check it include
hex strings of length 32 (eg, 128 bytes).
This commit is contained in:
Tobin C. Harding 2024-06-05 08:39:47 +10:00
parent 4ce7ee179a
commit 47e4bff0ee
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 1 additions and 1 deletions

View File

@ -497,7 +497,7 @@ impl U256 {
// Caller to ensure `s` does not contain a prefix.
fn from_hex_internal(s: &str) -> Result<Self, ParseIntError> {
let (high, low) = if s.len() < 32 {
let (high, low) = if s.len() <= 32 {
let low = parse::hex_u128_unchecked(s)?;
(0, low)
} else {