Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
12497fff
authored
Oct 26, 2017
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug the util class
parent
7191d245
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
fun-common-core/src/main/java/com/ctrip/fun/common/core/util/DateUtil.java
fun-common-core/src/main/java/com/ctrip/fun/common/core/util/EncryptUtil.java
fun-common-core/src/main/java/com/ctrip/fun/common/core/util/DateUtil.java
View file @
12497fff
...
...
@@ -363,6 +363,11 @@ public class DateUtil {
public
static
void
main
(
String
[]
args
)
throws
ParseException
{
DateUtil
.
getDates
(
"2014-05-26"
,
"2014-06-26"
,
"1"
);
System
.
out
.
println
(
DateUtil
.
addDays
(
new
Date
(),
1
));
long
day
=
getDistinceDay
(
parseDate
(
"2017-10-23"
),
new
Date
());
System
.
out
.
println
(
"day---->"
+
day
);
}
// 获取相隔天数
...
...
fun-common-core/src/main/java/com/ctrip/fun/common/core/util/EncryptUtil.java
View file @
12497fff
...
...
@@ -291,7 +291,8 @@ public class EncryptUtil {
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
String
src
=
"3e6f1a1c511148c492d7abc694f6a9"
;
// String src = "3e6f1a1c511148c492d7abc694f6a9";
String
src
=
"1234567.com"
;
byte
[]
key
=
{
67
,
116
,
114
,
105
,
112
,
46
,
73
,
87
,
97
,
110
,
45
,
71
,
111
,
108
,
102
,
64
,
68
,
83
,
84
,
53
,
56
,
53
,
48
,
57
};
byte
[]
result
=
EncryptUtil
.
encryptBy3Des
(
key
,
src
.
getBytes
());
String
base64str
=
new
String
(
Base64
.
encodeBase64
(
result
));
...
...
@@ -307,6 +308,16 @@ public class EncryptUtil {
System
.
out
.
println
(
getMD5Str
(
"12345"
));
System
.
out
.
println
(
authenticate
(
getMD5Str
(
"12345"
),
toByte
(
"641FD40ED3EBFA29C66A329C937F749538A64F0A"
),
toByte
(
"7D7B435E0A7DC4EA"
)));
byte
[]
bb
=
Base64
.
decodeBase64
(
"h3xP2d5oUbUh6xmwLKXa4Q=="
);
byte
[]
plain1
=
null
;
try
{
plain1
=
EncryptUtil
.
decryptBy3Des
(
key
,
bb
);
System
.
out
.
println
(
"plain1:"
+
new
String
(
plain1
));
}
catch
(
Exception
e
)
{
}
}
}
\ 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