MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / generateRandom

Function generateRandom

ui/src/components/AesKeyInput.tsx:33–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 };
32
33 const generateRandom = () => {
34 const cryptoObj = window.crypto || window.Crypto;
35 const b = new Uint8Array(16);
36 cryptoObj.getRandomValues(b);
37
38 const key = Buffer.from(b).toString("hex");
39 form.setFieldValue(props.name, key);
40 };
41
42 const copyToClipboard = () => {
43 const bytes = form.getFieldValue(props.name).match(/[A-Fa-f0-9]{2}/g);

Callers

nothing calls this directly

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected