mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
feat(kgm): expose db decrypt function
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use umc_kgm::{header::Header, Decipher};
|
||||
use umc_kgm::{decrypt_db, header::Header, Decipher};
|
||||
use wasm_bindgen::prelude::wasm_bindgen;
|
||||
use wasm_bindgen::JsError;
|
||||
|
||||
@@ -57,4 +57,10 @@ impl JsKuGou {
|
||||
pub fn decrypt(&self, buffer: &mut [u8], offset: usize) {
|
||||
self.0.decrypt(buffer, offset)
|
||||
}
|
||||
|
||||
/// Decrypt Kugou PC client db.
|
||||
#[wasm_bindgen(js_name=decryptDatabase)]
|
||||
pub fn decrypt_db(database: &mut [u8]) -> Result<(), JsError> {
|
||||
decrypt_db(database).map_err(JsError::from)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user