Skip to content

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

instance method

OpenSSL::Digest#block_length

digest.block_length → integer

Returns the block length of the digest algorithm, i.e. the length in bytes of an individual block. Most modern algorithms partition a message to be digested into a sequence of fix-sized blocks that are processed consecutively.

Example

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