Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Digest::Instance#digest

(?::string) -> ::String
digest_obj.digest → string
digest_obj.digest(string) → string

If none is given, returns the resulting hash value of the digest, keeping the digest’s state.

If a string is given, returns the hash value for the given string, resetting the digest to the initial state before and after the process.