Skip to content

Commit

Permalink
Fix beta issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jul 26, 2019
1 parent 187bffd commit 8864208
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,18 @@ pub(crate) fn validate_checksum(buffer: &[u8], expected: &str) -> Result<(), Err
let mut cur;

match exp[0] {
b'A'...b'F' => cur = exp[0] - b'A' + 10,
b'a'...b'f' => cur = exp[0] - b'a' + 10,
b'0'...b'9' => cur = exp[0] - b'0',
b'A'..=b'F' => cur = exp[0] - b'A' + 10,
b'a'..=b'f' => cur = exp[0] - b'a' + 10,
b'0'..=b'9' => cur = exp[0] - b'0',
c => bail!("invalid byte in expected checksum string {}", c),
}

cur <<= 4;

match exp[1] {
b'A'...b'F' => cur |= exp[1] - b'A' + 10,
b'a'...b'f' => cur |= exp[1] - b'a' + 10,
b'0'...b'9' => cur |= exp[1] - b'0',
b'A'..=b'F' => cur |= exp[1] - b'A' + 10,
b'a'..=b'f' => cur |= exp[1] - b'a' + 10,
b'0'..=b'9' => cur |= exp[1] - b'0',
c => bail!("invalid byte in expected checksum string {}", c),
}

Expand Down

0 comments on commit 8864208

Please sign in to comment.