End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Digest::SHA2#block_length
digest_obj.block_length → Integer
ext/digest/sha2/lib/sha2.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/ext/digest/sha2/lib/sha2.rb, line 112
def block_length
@sha2.block_length
end
Return the block length of the digest in bytes.
Example
Digest::SHA256.new.block_length * 8 # => 512 Digest::SHA384.new.block_length * 8 # => 1024 Digest::SHA512.new.block_length * 8 # => 1024