* fix: allow arbitrary name for repositories and correctly import existing local repos * chore: rebase conflicts
6 lines
239 B
TypeScript
6 lines
239 B
TypeScript
import crypto from "node:crypto";
|
|
|
|
export const generateShortId = (length = 5): string => {
|
|
const bytesNeeded = Math.ceil((length * 3) / 4);
|
|
return crypto.randomBytes(bytesNeeded).toString("base64url").slice(0, length).toLowerCase();
|
|
};
|