2022-12-13 21:13:17 -05:00
|
|
|
export const generateName = () => crypto.randomUUID();
|
2022-12-22 21:01:08 -05:00
|
|
|
export const generateUserId = () => crypto.randomUUID();
|
2022-06-30 14:18:44 -05:00
|
|
|
export const generateUsername = () => `usr_${crypto.randomUUID().replaceAll('-', '_')}`;
|
|
|
|
export const generatePassword = () => `pwd_${crypto.randomUUID()}`;
|
2022-07-20 22:37:51 -05:00
|
|
|
|
|
|
|
export const generateResourceName = () => `res_${crypto.randomUUID()}`;
|
|
|
|
export const generateResourceIndicator = () => `https://${crypto.randomUUID()}.logto.io`;
|
2022-11-09 03:25:54 -05:00
|
|
|
export const generateEmail = () => `${crypto.randomUUID().toLowerCase()}@logto.io`;
|
2023-01-11 03:13:35 -05:00
|
|
|
export const generateScopeName = () => `sc:${crypto.randomUUID()}`;
|
2022-07-31 20:51:27 -05:00
|
|
|
|
|
|
|
export const generatePhone = () => {
|
|
|
|
const array = new Uint32Array(1);
|
|
|
|
|
|
|
|
return crypto.getRandomValues(array).join('');
|
|
|
|
};
|
2022-12-26 06:59:33 -05:00
|
|
|
|
|
|
|
export const waitFor = async (ms: number) =>
|
|
|
|
new Promise((resolve) => {
|
|
|
|
setTimeout(resolve, ms);
|
|
|
|
});
|