1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 06:39:22 +02:00

Update base64 to 0.21 (#2966)

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
citreae535
2023-01-21 09:36:08 +08:00
committed by GitHub
parent 2f0b8a264a
commit b00fe72cf6
8 changed files with 18 additions and 9 deletions

View File

@ -86,7 +86,7 @@ h2 = { version = "0.3.9", optional = true }
# websockets
local-channel = { version = "0.1", optional = true }
base64 = { version = "0.13", optional = true }
base64 = { version = "0.21", optional = true }
rand = { version = "0.8", optional = true }
sha1 = { version = "0.10", optional = true }

View File

@ -3,6 +3,7 @@ use std::{
fmt,
};
use base64::prelude::*;
use tracing::error;
/// Operation codes defined in [RFC 6455 §11.8].
@ -244,7 +245,7 @@ pub fn hash_key(key: &[u8]) -> [u8; 28] {
};
let mut hash_b64 = [0; 28];
let n = base64::encode_config_slice(hash, base64::STANDARD, &mut hash_b64);
let n = BASE64_STANDARD.encode_slice(hash, &mut hash_b64).unwrap();
assert_eq!(n, 28);
hash_b64