KRandom Namespace

Helper to create random data. More...

Header: #include <KRandom>
CMake: find_package(KF6 REQUIRED COMPONENTS CoreAddons)
target_link_libraries(mytarget PRIVATE KF6::CoreAddons)

Functions

QString randomString(int length)

Detailed Description

This namespace provides methods which generate random data. KRandom is not recommended for serious random-number generation needs, like cryptography.

Function Documentation

QString KRandom::randomString(int length)

Generates a random string. It operates in the range [A-Za-z0-9] length Generate a string of this length. Returns the random string