You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. 异常 #1454
升级 commons-codec 至 1.13 版本后,加解密时出现 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. 异常
/** * Validates whether decoding the final trailing character is possible in the context * of the set of possible base 64 values. * * <p>The character is valid if the lower bits within the provided mask are zero. This * is used to test the final trailing base-64 digit is zero in the bits that will be discarded. * * @param emptyBitsMask The mask of the lower bits that should be empty * @param context the context to be used * * @throws IllegalArgumentException if the bits being checked contain any non-zero value */privatestaticvoidvalidateCharacter(finalintemptyBitsMask, finalContextcontext) {
if ((context.ibitWorkArea & emptyBitsMask) != 0) {
thrownewIllegalArgumentException(
"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.");
}
}