Method: Cryptor::Encoding.encode

Defined in:
lib/cryptor/encoding.rb

.encode(string) ⇒ String

Encode a string in unpadded URL-safe Base64

Parameters:

  • string (String)

    arbitrary string to be encoded

Returns:

  • (String)

    URL-safe Base64 encoded string (sans ‘=’ padding)



12
13
14
# File 'lib/cryptor/encoding.rb', line 12

def encode(string)
  Base64.urlsafe_encode64(string).sub(/=*$/, '')
end