Encode string to base32 string in Java

前端 未结 2 1345
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 10:35

Just like the title says, I am trying to encode a string \"test\" into base32 string \"ORSXG5A=\" in Java.

All I find when searching online is classes that encodes f

2条回答
  •  隐瞒了意图╮
    2020-12-06 11:10

    As @Sotirios Delimanolis wrote it can be done using apache commons but you can also use google guava libraries. For example:

    BaseEncoding.base32().encode("test".getBytes());
    

    will return ORSXG5A=.

    More information can be found here.

提交回复
热议问题