Skip to content
Source
Sign inSign up
Open History to see the last commit

uuid.ts

8 lines260 Bytes

1import * as Crypto from "expo-crypto";
2​
3export const uuidv4 = () => Crypto.randomUUID();
4​
5export const randomHex = (byteLength: number): string =>
6 Array.from(Crypto.getRandomBytes(byteLength), (byte) => byte.toString(16).padStart(2, "0")).join(
7 "",
8 );