From 2556d04120b4a00bc8f6436839976073cf61bceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Tue, 17 Sep 2024 21:48:14 +0100 Subject: [PATCH] [joox] docs #1: improve joox method docs --- um_wasm/src/exports/joox.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/um_wasm/src/exports/joox.rs b/um_wasm/src/exports/joox.rs index 8243906..eddf345 100644 --- a/um_wasm/src/exports/joox.rs +++ b/um_wasm/src/exports/joox.rs @@ -16,11 +16,14 @@ impl JsJooxFile { )) } + /// Get the buffer size to allocate for decrypt method. #[wasm_bindgen(getter, js_name = "bufferLength")] pub fn get_buffer_size(&self) -> usize { self.0.get_audio_block_size() } + /// Decrypt a given block of buffer (see {@link bufferLength}) + /// Return the length of decrypted & unpadded data from the input buffer. #[wasm_bindgen(js_name = "decrypt")] pub fn decrypt(&self, buffer: &mut [u8]) -> Result { let decrypted = self.0.decrypt_audio_block(buffer).map_err(JsError::from)?;