You've already forked joplin
							
							
				mirror of
				https://github.com/laurent22/joplin.git
				synced 2025-10-31 00:07:48 +02:00 
			
		
		
		
	Chore: Add function exports to lib/uuid module (#9560)
This commit is contained in:
		| @@ -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 }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user