Project

General

Profile

Actions

Task #91809

closed

Add possibility to create random values in JavaScript

Added by Oliver Hader over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Security
Target version:
-
Start date:
2020-07-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

`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).

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
});
Actions

Also available in: Atom PDF