functionland / fula-archived

Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
https://fx.land
MIT License
4 stars 0 forks source link

Chunking before encryption #167

Open mehdibalouchi opened 2 years ago

mehdibalouchi commented 2 years ago

Files should be chunked before getting encrypted in File protocol. Current implementation leads to file corruption (images are distorted after decryption in react-gallery sometimes).

farhoud commented 2 years ago

https://github.com/functionland/fula/blob/4229529b5b3dadd0a2792d12074240d165aaca52/protocols/file/src/handlers/save.ts#L16-L111

We do the chunking in Protocol for sendFile Or you can do it before fula and pass the chunck to sendStreamFile as asynciterable .