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
线程安全;
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)