Factorio seems to output base64 strings with wrong padding
Posted: Fri Aug 25, 2023 11:49 pm
I noticed that I cannot decode many the Base64 string that come out of Factorio, when the base64 decoder does not ignore the padding. For example, this one.
https://base64.guru/tools/validator says it is invalid
https://onlinebase64tools.com/validate-base64 says it is invalid
Javascript fetch() is unable to decode the string
Python also struggles, if you enforce validation.
I understand this is a very minor thing, but it would help if the base64 encoded string would have proper padding, because some libraries don't do well with it. JavaScripts atob() and fetch() does not work at all and you cannot disable strict mode.
https://base64.guru/tools/validator says it is invalid
https://onlinebase64tools.com/validate-base64 says it is invalid
Javascript fetch() is unable to decode the string
Code: Select all
const bpString = "0eNrNfV2PG8mR...y/8AuS2WkQ=="
const bpBinary = await fetch("data:application/octet-stream;base64," + bpString)
Code: Select all
bp_string = "0eNrNfV2PG8mR...y/8AuS2WkQ=="
base64.b64decode(s, validate=True)