End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Digest::Instance#digest_length
digest_obj.digest_length → integer
ext/digest/digest.c
View on GitHub ↗
static VALUE
rb_digest_instance_digest_length(VALUE self)
{
/* subclasses really should redefine this method */
VALUE digest = rb_digest_instance_digest(0, 0, self);
/* never blindly assume that #digest() returns a string */
StringValue(digest);
return LONG2NUM(RSTRING_LEN(digest));
}
Returns the length of the hash value of the digest.
This method should be overridden by each implementation subclass. If not, digest_obj.digest().length() is returned.