Changed depricated function in base64

This commit is contained in:
Piyush मिश्रः 2023-06-18 12:22:56 +05:30
parent 4e05d9a84d
commit 5b62442779
3 changed files with 9 additions and 5 deletions

View File

@ -17,8 +17,6 @@
use crate::ws_sansad::WsSansad;
use actix::prelude::*;
use dev::MessageResponse;
// use dev::ResponseChannel;
pub mod pind;
pub mod responses;

View File

@ -105,7 +105,7 @@ fn gen_rustls_server_config(key: String, cert: String) -> ServerConfig {
let private_key = PrivateKey(private_key.to_owned());
let mut config = ServerConfig::builder()
let config = ServerConfig::builder()
.with_safe_default_cipher_suites()
.with_safe_default_kx_groups()
.with_safe_default_protocol_versions()

View File

@ -17,7 +17,9 @@
use super::*;
use crate::config::CONFIG;
use base64::Engine;
use sha2::{Digest, Sha224};
impl WsSansad {
/// Request to join to kaksh
pub async fn join_kaksh(&mut self, val: Value) {
@ -56,7 +58,9 @@ impl WsSansad {
}
let mut hasher = Sha224::new();
hasher.update(format!("{}{}", kunjika, CONFIG.salt).as_bytes());
let kunjika = base64::encode(hasher.finalize())[..8].to_owned();
let kunjika = base64::engine::general_purpose::STANDARD_NO_PAD.encode(hasher.finalize())
[..8]
.to_owned();
// Name
let name = match val.get("name") {
@ -161,7 +165,9 @@ impl WsSansad {
}
let mut hasher = Sha224::new();
hasher.update(format!("{}{}", kunjika, &CONFIG.salt).as_bytes());
let kunjika = base64::encode(hasher.finalize())[..8].to_owned();
let kunjika = base64::engine::general_purpose::STANDARD_NO_PAD.encode(hasher.finalize())
[..8]
.to_owned();
// Name
let name = match val.get("name") {