mirror of https://github.com/PiyushXCoder/lupt.git
Changed depricated function in base64
This commit is contained in:
parent
4e05d9a84d
commit
5b62442779
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
use crate::ws_sansad::WsSansad;
|
||||
use actix::prelude::*;
|
||||
use dev::MessageResponse;
|
||||
// use dev::ResponseChannel;
|
||||
|
||||
pub mod pind;
|
||||
pub mod responses;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue