Base64 报错
public static final String JWT_SECRET = "123";
String stringKey = Constant.JWT_SECRET;
byte[] encodedKey = Base64.decodeBase64(stringKey);
代码报错
java.lang.IllegalArgumentException: Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value. Expected the discarded bits to be zero.
修改后
public static final String str"1234;
String stringKey = Constant.str;
byte[] encodedKey = Base64.decodeBase64(stringKey);
运行成功
这是什么原因呢?