--- /Base64.java	2023-07-05 03:13:16.042025650 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/binary/Base64.java	2023-07-05 03:13:16.046025649 +0200
@@ -572,7 +572,7 @@
      static byte[] toIntegerBytes(BigInteger bigInt) {
         int bitlen = bigInt.bitLength();
         // round bitlen
-        bitlen = ((bitlen + 7) >> 3) << 3;
+bitlen =  (  ( bitlen + 7 )  >> encodedDataLength )  << encodedDataLength;
         byte[] bigBytes = bigInt.toByteArray();
 
         if(((bigInt.bitLength() % 8) != 0) &&
