module Digest::Instance

def base64digest(str = nil)

contains no line feeds.
In either case, the return value is properly padded with '=' and

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

in a base64 encoded form, keeping the digest's state.
If none is given, returns the resulting hash value of the digest
def base64digest(str = nil)
  [str ? digest(str) : digest].pack('m0')
end

def base64digest!

initial state.
Returns the resulting hash value and resets the digest to the
def base64digest!
  [digest!].pack('m0')
end

def file(name)

returns self.
Updates the digest with the contents of a given file _name_ and
def file(name)
  File.open(name, "rb") {|f|
    buf = ""
    while f.read(16384, buf)
      update buf
    end
  }
  self
end