I have a piece of java code
enter code here
byte[] random1 = Base64.getDecoder().decode(arr.getString(2));
byte[] test1 = "/bCN99cbY13kwEf+wnRErg".getBytes(StandardCharsets.ISO_8859_1);
System.out.println(test1.length); // #22
System.out.println(Base64.getDecoder().decode(test1).length); // #16
I am trying to use python3 and I get an error.
text = bytes("/bCN99cbY13kwEf+wnRErg", encoding='iso-8859-1')
print(len(base64.b64decode(text)))
# Traceback (most recent call last):
# File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\base64.py", line
# 546, in decodebytes
# return binascii.a2b_base64(s)
# binascii.Error: Incorrect padding
How can I use python3 to implement the functions on the java code to achieve decode length=16