MCPcopy Create free account
hub / github.com/BladeTransformerLLC/gauzilla / create_url_byte_array

Function create_url_byte_array

src/utils.rs:143–150  ·  view source on GitHub ↗
(bytes: Vec<u8>)

Source from the content-addressed store, hash-verified

141/// Creates URL of a byte array
142#[inline(always)]
143pub 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

Callers 1

load_spzFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected