Using this regexp: https://regex101.com/r/rZ2dE2/1
https://github.com/dankogai/js-base64/blob/9192c510f5ed604d9e9dcdbb6760eba5a9eb2851/base64.min.js kudos Dan Kogai small improvements to input checking implementing default values for most configuration options switching to versioned JS files to avoid version hack used in template