From 7b283a5a147d3c228eea26d395761e2d1004a490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Sat, 14 Sep 2024 01:33:23 +0100 Subject: [PATCH] refactor: rearrange code --- um_crypto/kuwo/src/lib.rs | 7 +++---- um_crypto/utils/src/base64.rs | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/um_crypto/kuwo/src/lib.rs b/um_crypto/kuwo/src/lib.rs index ca09125..3d64679 100644 --- a/um_crypto/kuwo/src/lib.rs +++ b/um_crypto/kuwo/src/lib.rs @@ -1,16 +1,15 @@ +use crate::kwm_v1::CipherV1; use anyhow::Result; use byteorder::{ReadBytesExt, LE}; use std::io::{Cursor, Read}; +use thiserror::Error; +use umc_qmc::QMCv2Cipher; pub mod des; pub mod kwm_v1; pub use umc_qmc::QMCv2Cipher as CipherV2; -use crate::kwm_v1::CipherV1; -use thiserror::Error; -use umc_qmc::QMCv2Cipher; - /// Commonly used secret key for Kuwo services. pub const SECRET_KEY: [u8; 8] = *b"ylzsxkwm"; diff --git a/um_crypto/utils/src/base64.rs b/um_crypto/utils/src/base64.rs index 5d38f52..c49fa0c 100644 --- a/um_crypto/utils/src/base64.rs +++ b/um_crypto/utils/src/base64.rs @@ -1,5 +1,7 @@ use base64::engine::{DecodePaddingMode, GeneralPurpose as Base64Engine, GeneralPurposeConfig}; -use base64::{alphabet, DecodeError, Engine}; +use base64::{alphabet, Engine}; + +pub use base64::DecodeError; /// Don't add padding when encoding, and require no padding when decoding. pub const ENGINE: Base64Engine = Base64Engine::new(