mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 15:46:29 +08:00
c9bffc13b5
fix #13529 #### PR Dependency Tree * **PR #14481** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Mobile blob caching with file-backed storage for faster loads and reduced network usage * Blob decoding with lazy refresh on token-read failures for improved reliability * Full-text search/indexing exposed to mobile apps * Document sync APIs and peer clock management for robust cross-device sync * **Tests** * Added unit tests covering payload decoding, cache safety, and concurrency * **Dependencies** * Added an LRU cache dependency and a new mobile-shared package for shared mobile logic <!-- end of auto-generated comment: release notes by coderabbit.ai -->
12 lines
330 B
Rust
12 lines
330 B
Rust
use crate::{Result, UniffiError};
|
|
|
|
pub(crate) fn decode_base64_data(data: &str) -> Result<Vec<u8>> {
|
|
base64_simd::STANDARD
|
|
.decode_to_vec(data)
|
|
.map_err(|err| UniffiError::Base64DecodingError(err.to_string()))
|
|
}
|
|
|
|
pub(crate) fn encode_base64_data(data: &[u8]) -> String {
|
|
base64_simd::STANDARD.encode_to_string(data)
|
|
}
|