(bytes: Vec<u8>)
| 141 | /// Creates URL of a byte array |
| 142 | #[inline(always)] |
| 143 | pub fn create_url_byte_array(bytes: Vec<u8>) -> Result<String, JsValue> { |
| 144 | let array = js_sys::Uint8Array::from(bytes.as_slice()); |
| 145 | let array = js_sys::Array::of1(&JsValue::from(array)); |
| 146 | let blob = Blob::new_with_u8_array_sequence(&array)?; |
| 147 | let url = Url::create_object_url_with_blob(&blob)?; |
| 148 | |
| 149 | Ok(url) |
| 150 | } |
| 151 | |
| 152 | |
| 153 | /// Incremental Moving Average |