class BitJWT::Util

Public Class Methods

base64url_encode(str) click to toggle source
# File lib/bitjwt/util.rb, line 12
def base64url_encode(str)
  Base64.encode64(str).tr('+/', '-_').gsub(/[\n=]/, '')
end
bin_to_hex(bin) click to toggle source
# File lib/bitjwt/util.rb, line 8
def bin_to_hex(bin)
  bin.unpack('H*')[0]
end
hex_to_bin(hex) click to toggle source
# File lib/bitjwt/util.rb, line 4
def hex_to_bin(hex)
  [hex].pack('H*')
end