new(p1, p2 = v2) public

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.

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

is equal to

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

Example

digest = OpenSSL::Digest.new('sha1')
Show source
Register or log in to add new notes.