title: Base64 encode with no padding on ruby 2.2
body: <p>I'm attempting to base64 encode some things in ruby 2.2 (environment limitation) without padding.  I know that in ruby 2.3 the base64 library added a padding flag that can do this for me.  However, when I attempt to do this myself in ruby 2.2 using </p>
  
  <pre><code>Base64.urlsafe_encode464(str).gsub('=', '')
  </code></pre>
  
  <p>This creates issues for me when decoding however.  Is there a way to update to the latest base64 library while staying on ruby 2.2? Or is there a good way to do a urlsafe base64 encoding that will decode correctly?</p>