Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
YeeAmosFireAutoSysRoot
Commits
d9a3eaee
Commit
d9a3eaee
authored
Mar 26, 2024
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
漏洞文件漏洞修改 - 随机数安全性问题
parent
4614a5ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
22 deletions
+0
-22
RandomUtil.java
...n/java/com/yeejoin/amos/fas/business/util/RandomUtil.java
+0
-22
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/util/RandomUtil.java
View file @
d9a3eaee
...
...
@@ -19,26 +19,4 @@ public class RandomUtil {
}
return
newDate
+
result
;
}
/**
* @param resourceType 资源类型
* @param companyCode 单位编号
* @Description Random存在性能问题可能造成线程阻塞问题,使
* 用性能更加卓越的threadLocalRandom(线程安全的单例模式)生成随机数
* 四位随机数无法保证不可重复性,如果对不可重复要求高,请使用其他工具
* @Author songLei
* @Return String
* @Date 2020/12/18 11:49
*/
public
static
String
buildNo
(
String
resourceType
,
String
companyCode
)
{
threadLocalRandom
=
ThreadLocalRandom
.
current
();
int
num
=
threadLocalRandom
.
nextInt
(
1000
,
9999
);
return
resourceType
+
companyCode
+
num
;
}
public
static
String
buildNo
()
{
threadLocalRandom
=
ThreadLocalRandom
.
current
();
int
num
=
threadLocalRandom
.
nextInt
(
1000
,
9999
);
return
String
.
valueOf
(
num
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment