instance method
generate
Ruby on Rails 5.0.7.2
Since v2.3.18Signature
generate(value)
Generates a signed message for the provided value.
The message is signed with the MessageVerifier‘s secret. Without knowing the secret, the original value cannot be extracted from the message.
verifier = ActiveSupport::MessageVerifier.new 's3Krit'
verifier.generate 'a private message' # => "BAhJIhRwcml2YXRlLW1lc3NhZ2UGOgZFVA==--e2d724331ebdee96a10fb99b089508d1c72bd772"
Parameters
-
valuereq
Source
# File activesupport/lib/active_support/message_verifier.rb, line 115
def generate(value)
data = encode(@serializer.dump(value))
"#{data}--#{generate_digest(data)}"
end
Defined in activesupport/lib/active_support/message_verifier.rb line 115
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::MessageVerifier