instance method
OpenSSL::Digest#block_length
() -> ::Integer
digest.block_length → integer
ext/openssl/ossl_digest.c
View on GitHub ↗
static VALUE
ossl_digest_block_length(VALUE self)
{
EVP_MD_CTX *ctx;
GetDigest(self, ctx);
return INT2NUM(EVP_MD_CTX_block_size(ctx));
}
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