import org.apache.commons.codec.binary.Base64;

//下载commons-codec-1.11-bin.zip,调用commons-codec-1.11.jar

Base64 base64 = new Base64();
String base64Sign = base64.encodeToString(string.getBytes("UTF-8"));


//其中汉字需要UTF-8处理,否则编码后会乱码。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案