Skip to content

Commit

Permalink
Update to sha-1 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Jul 28, 2020
1 parent fd7de42 commit 849f248
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 3 additions & 3 deletions src/handshake/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 849f248

Please sign in to comment.