Skip to content

Commit 2997360

Browse files
authored
Merge pull request #6 from IvanUkhov/md5
Update the md5 crate
2 parents cff737e + 85d7b7b commit 2997360

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ readme = "README.md"
1111
[dependencies]
1212
byteorder = "1.0"
1313
fallible-iterator = "0.1"
14-
hex = "0.2"
15-
md5 = "0.2"
14+
md5 = "0.3"
1615
memchr = "1.0"

src/authentication.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Authentication protocol support.
2-
use hex::ToHex;
32
use md5::Context;
43

54
/// Hashes authentication information in a way suitable for use in response
@@ -14,9 +13,9 @@ pub fn md5_hash(username: &[u8], password: &[u8], salt: [u8; 4]) -> String {
1413
context.consume(username);
1514
let output = context.compute();
1615
context = Context::new();
17-
context.consume(output.to_hex().as_bytes());
16+
context.consume(format!("{:x}", output));
1817
context.consume(&salt);
19-
format!("md5{}", context.compute().to_hex())
18+
format!("md5{:x}", context.compute())
2019
}
2120

2221
#[cfg(test)]

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![warn(missing_docs)]
1414
extern crate byteorder;
1515
extern crate fallible_iterator;
16-
extern crate hex;
1716
extern crate md5;
1817
extern crate memchr;
1918

0 commit comments

Comments
 (0)