If you need to check this programmatically, you can do this by checking the module. Here's some psudocode (no specific language):
function base64Inflation (numBytes)
minimumBase64Bytes = roundDown (numBytes / 3 * 4)
modulus = numberOfBytes% 3 // Assuming% is the modulo operator
if modulus == 0
return minimumBase64Bytes // Exact fit! No padding required.
else
return minimumBase64Bytes + 4 // Doesn't quite fit. We need to pad.
I also implemented the same logic in golang:
http://play.golang.org/p/JK9XPAle5_
source share