MCPcopy Create free account
hub / github.com/aghyad97/browserytools / generateRandomKey

Function generateRandomKey

src/components/TextEncryption.tsx:66–70  ·  view source on GitHub ↗
(length = 24)

Source from the content-addressed store, hash-verified

64}
65
66function generateRandomKey(length = 24): string {
67 const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";
68 const arr = crypto.getRandomValues(new Uint8Array(length));
69 return Array.from(arr, (b) => chars[b % chars.length]).join("");
70}
71export default function TextEncryption() {
72 const t = useTranslations("Tools.TextEncryption");
73 const tc = useTranslations("ToolsConfig");

Callers 1

doGenerateKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected