byte[] cipherData = Base64.encodeBase64(plainText.getBytes()); //默认不换行    
    byte[] cipherData = Base64.encodeBase64(plainText.getBytes(), false); //取消换行  
    byte[] cipherData = Base64.encodeBase64Chunked(plainText.getBytes()); //进行换行  
    String cipherText = Base64.encodeBase64String(plainText.getBytes()); //转为字符串  

  2. 安全的url:转换+为-、/为_、将多余的=去掉
Java代码 

    byte[] cipherData = Base64.encodeBase64(plainText.getBytes(), false, true);  
    byte[] cipherData = Base64.encodeBase64URLSafe(plainText.getBytes());  
    String cipherText = Base64.encodeBase64URLSafeString(plainText.getBytes()); 

 

相关文章:

  • 2022-12-23
  • 2021-08-03
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
猜你喜欢
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案