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

Function generateRandom

ui/src/components/RelayIdInput.tsx:71–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 };
70
71 const generateRandom = () => {
72 const cryptoObj = window.crypto || window.Crypto;
73 const b = new Uint8Array(4);
74 cryptoObj.getRandomValues(b);
75
76 const key = Buffer.from(b).toString("hex");
77 setValue(key);
78 updateField(key);
79 };
80
81 const copyToClipboard = () => {
82 const bytes = value.match(/[A-Fa-f0-9]{2}/g);

Callers

nothing calls this directly

Calls 2

updateFieldFunction · 0.85
fromMethod · 0.45

Tested by

no test coverage detected