Fix a logic problem in base58 (isn't a real bug)
This commit is contained in:
parent
1d01262d5c
commit
abc70781e7
|
@ -131,7 +131,7 @@ pub fn from(data: &str) -> Result<Vec<u8>, Error> {
|
||||||
// Build in base 256
|
// Build in base 256
|
||||||
for d58 in data.bytes() {
|
for d58 in data.bytes() {
|
||||||
// Compute "X = X * 58 + next_digit" in base 256
|
// Compute "X = X * 58 + next_digit" in base 256
|
||||||
if d58 as usize > BASE58_DIGITS.len() {
|
if d58 as usize >= BASE58_DIGITS.len() {
|
||||||
return Err(Error::BadByte(d58));
|
return Err(Error::BadByte(d58));
|
||||||
}
|
}
|
||||||
let mut carry = match BASE58_DIGITS[d58 as usize] {
|
let mut carry = match BASE58_DIGITS[d58 as usize] {
|
||||||
|
|
Loading…
Reference in New Issue