mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
[joox] docs #1: improve joox method docs
This commit is contained in:
@@ -16,11 +16,14 @@ impl JsJooxFile {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the buffer size to allocate for decrypt method.
|
||||||
#[wasm_bindgen(getter, js_name = "bufferLength")]
|
#[wasm_bindgen(getter, js_name = "bufferLength")]
|
||||||
pub fn get_buffer_size(&self) -> usize {
|
pub fn get_buffer_size(&self) -> usize {
|
||||||
self.0.get_audio_block_size()
|
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")]
|
#[wasm_bindgen(js_name = "decrypt")]
|
||||||
pub fn decrypt(&self, buffer: &mut [u8]) -> Result<usize, JsError> {
|
pub fn decrypt(&self, buffer: &mut [u8]) -> Result<usize, JsError> {
|
||||||
let decrypted = self.0.decrypt_audio_block(buffer).map_err(JsError::from)?;
|
let decrypted = self.0.decrypt_audio_block(buffer).map_err(JsError::from)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user