End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Digest::Instance#base64digest
base64digest(str = nil)
ext/digest/lib/digest.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/ext/digest/lib/digest.rb, line 82
def base64digest(str = nil)
[str ? digest(str) : digest].pack('m0')
end
If none is given, returns the resulting hash value of the digest in a base64 encoded form, keeping the digest’s state.
If a string is given, returns the hash value for the given string in a base64 encoded form, resetting the digest to the initial state before and after the process.
In either case, the return value is properly padded with ‘=’ and contains no line feeds.