new

Digest.new(string [, data]) â Digest
Class Public methods

Creates a Digest instance based on string, which is either the ln (long name) or sn (short name) of a supported digest algorithm. If data (a String) is given, it is used as the initial input to the Digest instance, i.e.

1
digest = OpenSSL::Digest.new('sha256', 'digestdata')

is equal to

1
2
digest = OpenSSL::Digest.new('sha256')
digest.update('digestdata')

Example

1
digest = OpenSSL::Digest.new('sha1')
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.