Java中的Base64编码字符,如何在Java中执行

时间:2018-12-30 07:33:02

标签: java-8 base64

我想基于当前时间创建此字符串。

例如:

2014 06 04 16 21 20 79 ---> 14 06 04 16 21 20 79

然后,我可以使用表格(http://en.wikipedia.org/wiki/Base64来翻译字母数字字符的每两位数字(最后两位除外)-请注意,它们都小于59)

然后

14 - O
06 - G
04 - E
16 - Q
21 - V
20 - U

SimpleDateFormat formatter = new SimpleDateFormat("MM.dd.HH.mm.ss");
String timeStamp = formatter.format(new java.util.Date());
String[] data = timeStamp.split(".", 5);

String abc = new String();
for (int j = 0; j < 5; j++) {
    abc = abc.concat(StringUtils.newStringUtf8(Base64.decodeBase64(data[j])));
}

0 个答案:

没有答案