Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

OpenSSL::Digest#digest_length

digest.digest_length → integer

Returns the output size of the digest, i.e. the length in bytes of the final message digest result.

Example

Example
digest = OpenSSL::Digest.new('SHA1')
puts digest.digest_length # => 20
See also #block_length #finish #<< #initialize_copy also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1