()
| 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); |