Update to sha-1 0.9

pull/132/head
Sebastian Dröge 4 years ago
parent fd7de42347
commit 849f248a94
  1. 2
      Cargo.toml
  2. 6
      src/handshake/mod.rs

@ -26,7 +26,7 @@ httparse = "1.3.4"
input_buffer = "0.3.0"
log = "0.4.8"
rand = "0.7.2"
sha-1 = "0.8.1"
sha-1 = "0.9"
url = "2.1.0"
utf-8 = "0.7.5"

@ -118,9 +118,9 @@ fn convert_key(input: &[u8]) -> Result<String, Error> {
// ... with the string "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" (RFC 6455)
const WS_GUID: &[u8] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
let mut sha1 = Sha1::default();
sha1.input(input);
sha1.input(WS_GUID);
Ok(base64::encode(&sha1.result()))
sha1.update(input);
sha1.update(WS_GUID);
Ok(base64::encode(&sha1.finalize()))
}
#[cfg(test)]

Loading…
Cancel
Save