Random

maven

1
2
3
4
5
6
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.9</version>
</dependency>

  

org.apache.commons.lang3.RandomUtils

概述

Utility library that supplements the standard {@link Random} class.
工具库 支持 标准的Random;


Caveat: Instances of {@link Random} are not cryptographically secure.
警告:Random实例 在加密上是不安全的;


Please note that the Apache Commons project provides a component dedicated to pseudo-random number generation,

namely <a href="https://commons.apache.org/rng">Commons RNG</a>, that may be a better choice for applications with more stringent requirements (performance and/or correctness).

Apache Commons project 提供了一个专门用于 生成伪随机数的组件(Commons RNG,可能是一个更好的选择 对于更高要求的应用);

 

 

org.apache.commons.lang3.RandomStringUtils

概述

Operations for random {@code String}s.

生成 随机String; 


Currently <em>private high surrogate</em> 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 high surrogate is randomly chosen, 55296 (d800) to 56191 (db7f) 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.private high surrogate字符被忽略,这些是介于 56192和56319之间的Unicode字符,不知道如何处理它们;

 

RandomStringUtils is intended for simple use cases.

For more advanced use cases consider using commons-text <a href="https://commons.apache.org/proper/commons-text/javadocs/api-release/org/apache/commons/text/RandomStringGenerator.html"> RandomStringGenerator</a> instead.

RandomStringUtils适用于 简单的用例; 对于 更高级的用例,请使用RandomStringGenerator

 

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

警告:Random实例,是 加密不安全的;

 

ThreadSafe

线程安全

 

posted on   anpeiyong  阅读(33)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示