diff --git a/Cargo.toml b/Cargo.toml index 8da2312..fc8f19e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ log = "0.4.1" mio = "0.6.14" mio-extras = "2.0" rand = "0.7" -sha-1 = "0.8.0" +sha-1 = "0.9" slab = "0.4" url = "2.0.0" diff --git a/src/handshake.rs b/src/handshake.rs index b7520bd..7d5ca23 100644 --- a/src/handshake.rs +++ b/src/handshake.rs @@ -22,10 +22,10 @@ fn generate_key() -> String { pub fn hash_key(key: &[u8]) -> String { let mut hasher = sha1::Sha1::new(); - hasher.input(key); - hasher.input(WS_GUID.as_bytes()); + hasher.update(key); + hasher.update(WS_GUID.as_bytes()); - encode_base64(&hasher.result()) + encode_base64(&hasher.finalize()) } // This code is based on rustc_serialize base64 STANDARD