| 1 | import * as Crypto from "expo-crypto"; |
| 2 | |
| 3 | export const uuidv4 = () => Crypto.randomUUID(); |
| 4 | |
| 5 | /** Random lowercase hex string of `byteLength` bytes (2 chars per byte). */ |
| 6 | export const randomHex = (byteLength: number): string => |
| 7 | Array.from(Crypto.getRandomBytes(byteLength), (byte) => byte.toString(16).padStart(2, "0")).join( |
| 8 | "", |
| 9 | ); |