mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
Adds document access tokens and QR code functionality to enable secure document sharing via URLs. It includes a new document access page that allows viewing and downloading documents through tokenized links.
12 lines
335 B
TypeScript
12 lines
335 B
TypeScript
import { customAlphabet } from 'nanoid';
|
|
|
|
export const alphaid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 21);
|
|
|
|
export { nanoid } from 'nanoid';
|
|
|
|
export const fancyId = customAlphabet('abcdefhiklmnorstuvwxyz', 16);
|
|
|
|
export const prefixedId = (prefix: string, length = 16) => {
|
|
return `${prefix}_${fancyId(length)}`;
|
|
};
|