The thumbhash bytes will be stored as base64 string so we need a function to decode it.
This code, similarly to the encode function, is based on this article, with slight modifications.
Differential D7758
[native] Add C++ function to decode base64 bartek on May 9 2023, 6:18 AM. Authored by Tags None Referenced Files
Details
The thumbhash bytes will be stored as base64 string so we need a function to decode it. This code, similarly to the encode function, is based on this article, with slight modifications. This will be tested together with the next diff.
Diff Detail
Event TimelineComment Actions Are we doing this so performance is better than it would be in a pure-JS implementation? Given you've already done it I guess we should keep it (assuming you avoided copy-paste), but in the future when we need performant low-level implementations of crypto functionality, I would if it would be easier to bridge to a Rust library than to implement "from scratch" in C++ Comment Actions Looks good, I am a bit afraid there are too many similarities between this and source code from the article, but you said it's based on the article so assuming it was only an inspiration.
Comment Actions If this was copy-pasted you should follow the third_party approach we've outlined before and include the LICENSE
|