def to_base64(number)
            return Base64.urlsafe_encode64(("0"*(64-number.to_s(16).size) + number.to_s(16)).scan(/../).map{|x| x.hex.chr}.join)
        end
def to_base64(number)
            return Base64.urlsafe_encode64(("0"*(64-number.to_s(16).size) + number.to_s(16)).scan(/../).map{|x| x.hex.chr}.join)
        end
The to_base64 and from_base64 converts between base 10 and base 64
 integers, with a left-zero-padded, fixed-size hex representation.
 This is cross-compatible with the go implementation, and by changing
 base versus encoding as a string, it reduces the size of the
 representation. Note: the output is always 44 characters.