Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-enterprise-base
Overview
Overview
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
base_platform_enterprise
gic-enterprise-base
Commits
0af04a6e
Commit
0af04a6e
authored
Aug 13, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成随机数工具类
parent
83779fca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
CreateRandomUtils.java
...main/java/com/gic/enterprise/utils/CreateRandomUtils.java
+20
-2
gic-enterprise-base.iml
gic-enterprise-base.iml
+12
-2
No files found.
gic-enterprise-base-api/src/main/java/com/gic/enterprise/utils/Create
PasswordAuto
Utils.java
→
gic-enterprise-base-api/src/main/java/com/gic/enterprise/utils/Create
Random
Utils.java
View file @
0af04a6e
...
...
@@ -3,13 +3,13 @@ package com.gic.enterprise.utils;
import
java.util.Random
;
/**
*
随机生成字母、数字参合的密码
*
生成随机数工具类
* @ClassName: CreatePasswordAutoUtils
* @Description:
* @author guojuxing
* @date 2019/8/9 4:39 PM
*/
public
class
Create
PasswordAuto
Utils
{
public
class
Create
Random
Utils
{
/**
* 随机生成字母、数字参合的密码
* @param length 生成多少位数的密码
...
...
@@ -33,4 +33,22 @@ public class CreatePasswordAutoUtils {
}
return
val
;
}
/**
* 随机生成0-9的数字
* @Title: generateNumberStr
* @Description:
* @author guojuxing
* @param length 生成多少位数
* @return java.lang.String
*/
public
static
String
generateNumberStr
(
int
length
)
{
String
numberChar
=
"0123456789"
;
StringBuilder
sb
=
new
StringBuilder
();
Random
random
=
new
Random
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
sb
.
append
(
numberChar
.
charAt
(
random
.
nextInt
(
numberChar
.
length
())));
}
return
sb
.
toString
();
}
}
gic-enterprise-base.iml
View file @
0af04a6e
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
/>
\ No newline at end of file
<module
version=
"4"
>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_8"
>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/target"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
</component>
</module>
\ No newline at end of file
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