Task #91809
Updated by Oliver Hader over 4 years ago
`SecurityUtility. getRandomHexValue(20)` returns 20 hexadecimal characters provided by the Web Crypto API (see https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API).
<pre>
require(['TYPO3/CMS/Core/SecurityUtility'], (SecurityUtility) => {
const security = new SecurityUtility();
console.log(security.getRandomHexValue(10));
console.log(security.getRandomHexValue(11));
console.log(security.getRandomHexValue(-Infinity)); // fails of course
});
</pre>