Improved base64 encoding validator after benchmarking different scenarios