We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7170201 commit a317456Copy full SHA for a317456
src/rust-crypto/digest.rs
@@ -8,8 +8,6 @@
8
// option. This file may not be copied, modified, or distributed
9
// except according to those terms.
10
11
-use std::num::ToStrRadix;
12
-
13
/**
14
* The Digest trait specifies an interface common to digest functions, such as SHA-1 and the SHA-2
15
* family of digest functions.
@@ -81,10 +79,7 @@ pub trait Digest {
81
79
fn to_hex(rr: &[u8]) -> String {
82
80
let mut s = String::new();
83
for b in rr.iter() {
84
- let hex = (*b as uint).to_str_radix(16u);
85
- if hex.len() == 1 {
86
- s.push_char('0');
87
- }
+ let hex = format!("{:02x}", *b);
88
s.push_str(hex.as_slice());
89
}
90
return s;
0 commit comments