method
new
v2_2_9 -
Show latest stable
- Class:
OpenSSL::Digest
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')