Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

OpenSSL#Digest

(::interned name) -> singleton(::Digest::Base)
Digest(name)

Returns a Digest subclass by name

Example
require 'openssl'

OpenSSL::Digest("MD5")
# => OpenSSL::Digest::MD5

OpenSSL::Digest("Foo")
# => NameError: wrong constant name Foo