Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

380 B
Raw Blame
import { customAlphabet } from "nanoid";

// Exclude "-" for editor selection and "_" so prefixes remain unambiguous.
export const alphabet =
    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

// The extra character compensates for the smaller alphabet.
const nanoid = customAlphabet(alphabet, 22);

export const newID = (prefix: string) => prefix + nanoid();