class ActiveSupport::MessageVerifier

def generate(value, expires_at: nil, expires_in: nil, purpose: nil)

verifier.generate 'a private message' # => "BAhJIhRwcml2YXRlLW1lc3NhZ2UGOgZFVA==--e2d724331ebdee96a10fb99b089508d1c72bd772"
verifier = ActiveSupport::MessageVerifier.new 's3Krit'

Returns Base64-encoded message joined with the generated signature.
The message is signed with the +MessageVerifier+'s secret.

Generates a signed message for the provided value.
def generate(value, expires_at: nil, expires_in: nil, purpose: nil)
  data = encode(Messages::Metadata.wrap(@serializer.dump(value), expires_at: expires_at, expires_in: expires_in, purpose: purpose))
  "#{data}#{SEPARATOR}#{generate_digest(data)}"
end