diff --git a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java index becc26830..b74183618 100644 --- a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java +++ b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java @@ -19,8 +19,22 @@ package org.apache.commons.lang3; import java.util.Random; /** - *

Operations for random {@code String}s.

- *

Currently private high surrogate characters are ignored. + *

Generates random {@code String}s.

+ * + *

Caveat: Instances of {@link Random}, upon which the implementation of this + * class relies, are not cryptographically secure.

+ * + *

RandomStringUtils is intended for simple use cases. For more advanced + * use cases consider using Apache Commons Text's + * + * RandomStringGenerator instead.

+ * + *

The Apache Commons project provides + * Commons RNG dedicated to pseudo-random number generation, that may be + * a better choice for applications with more stringent requirements + * (performance and/or correctness).

+ * + *

Note that private high surrogate characters are ignored. * These are Unicode characters that fall between the values 56192 (db80) * and 56319 (dbff) as we don't know how to handle them. * High and low surrogates are correctly dealt with - that is if a @@ -28,19 +42,6 @@ import java.util.Random; * then it is followed by a low surrogate. If a low surrogate is chosen, * 56320 (dc00) to 57343 (dfff) then it is placed after a randomly * chosen high surrogate.

- *

RandomStringUtils is intended for simple use cases. For more advanced - * use cases consider using commons-text - * - * RandomStringGenerator instead.

- * - *

Caveat: Instances of {@link Random}, upon which the implementation of this - * class relies, are not cryptographically secure.

- * - *

Please note that the Apache Commons project provides a component - * dedicated to pseudo-random number generation, namely - * Commons RNG, that may be - * a better choice for applications with more stringent requirements - * (performance and/or correctness).

* *

#ThreadSafe#

* @since 1.0