diff --git a/packages/lib/uuid.ts b/packages/lib/uuid.ts index e4e9a44b7..a99174646 100644 --- a/packages/lib/uuid.ts +++ b/packages/lib/uuid.ts @@ -1,6 +1,6 @@ import { v4 as uuidv4 } from 'uuid'; import { customAlphabet } from 'nanoid/non-secure'; -import { nanoid as nanoidSecure } from 'nanoid'; +import { nanoid as nanoidSecure, customAlphabet as customAlphabetSecure } from 'nanoid'; // https://zelark.github.io/nano-id-cc/ // https://security.stackexchange.com/a/41749/1873 @@ -17,9 +17,6 @@ export default { createNano: function(): string { return nanoid(); }, - createNanoForInboxEmail: (): string => { - return customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 8)(); - }, }; export const createSecureRandom = (size = 32) => { @@ -42,3 +39,9 @@ export const uuidgen = (length = 22) => { const cachedUuidgen = getCachedUuidgen(length); return cachedUuidgen(); }; + +export const createNanoForInboxEmail = (): string => { + return customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 8)(); +}; + +export { customAlphabetSecure };