Update to sha-1 0.9

This commit is contained in:
Sebastian Dröge 2020-07-28 09:34:31 +03:00
parent fd7de42347
commit 849f248a94
2 changed files with 4 additions and 4 deletions

View File

@ -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"

View File

@ -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)]