Sha256: 2ffd2fd3b28094e98327f7bfa589fecaaa4a2aafa46dbd27e9561bf181eec985
Contents?: true
Size: 361 Bytes
Versions: 11
Compression:
Stored size: 361 Bytes
Contents
# frozen_string_literal: true require 'base64' module JWT # Base64 helpers class Base64 class << self def url_encode(str) ::Base64.encode64(str).tr('+/', '-_').gsub(/[\n=]/, '') end def url_decode(str) str += '=' * (4 - str.length.modulo(4)) ::Base64.decode64(str.tr('-_', '+/')) end end end end
Version data entries
11 entries across 11 versions & 2 rubygems