Hello!
I was wondering if there's any way to turn an ArrayBuffer into a Blob. If I understand correctly, the JavaScript implementation of new Blob(...) allows for passing an array of blob parts, which can include ArrayBuffer (js) and ArrayBufferView (js). I don't see anything similar in the Web.File.Blob docs though, so I was wondering if there's a recommended way to do this.
My use case, in case of XY problems: I'm downloading an encrypted file using purescript-fetch, then decrypting it using purescript-subtlecrypto, which yields an ArrayBuffer (which I have a known image/* MIME for) that I want to display to the user. I know I could use data urls, but I'd like to avoid the memory/cpu overhead if possible.
Also, I'm a bit of a purescript novice, so apologies in advance if I've missed something that's obvious to more experienced users.
Thanks for your help!
Hello!
I was wondering if there's any way to turn an
ArrayBufferinto aBlob. If I understand correctly, the JavaScript implementation ofnew Blob(...)allows for passing an array of blob parts, which can includeArrayBuffer(js) andArrayBufferView(js). I don't see anything similar in theWeb.File.Blobdocs though, so I was wondering if there's a recommended way to do this.My use case, in case of XY problems: I'm downloading an encrypted file using
purescript-fetch, then decrypting it usingpurescript-subtlecrypto, which yields anArrayBuffer(which I have a knownimage/*MIME for) that I want to display to the user. I know I could use data urls, but I'd like to avoid the memory/cpu overhead if possible.Also, I'm a bit of a purescript novice, so apologies in advance if I've missed something that's obvious to more experienced users.
Thanks for your help!