slopus--happy
98e40dac97
CLI Smoke Test / smoke-test-linux (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-linux (24) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (24) (push) Has been cancelled
Expo App TypeScript typecheck / typecheck (push) Has been cancelled
12 行
453 B
TypeScript
12 行
453 B
TypeScript
/**
|
|
* Read file bytes from a URI — native implementation.
|
|
* Uses expo-file-system/legacy to read file:// URIs on iOS/Android.
|
|
*/
|
|
import { readAsStringAsync, EncodingType } from 'expo-file-system/legacy';
|
|
import { decodeBase64 } from '@/encryption/base64';
|
|
|
|
export async function readFileBytes(uri: string): Promise<Uint8Array> {
|
|
const base64 = await readAsStringAsync(uri, { encoding: EncodingType.Base64 });
|
|
return decodeBase64(base64);
|
|
}
|