Thoughts about using the strict version here instead?

http://ruby-doc.org/stdlib-2.1.0/libdoc/base64/rdoc/Base64.html

Just finished fighting with an api that was failing because the key had whitespace.