Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Digest::Instance#file
(::string name) -> instance
file(name)
ext/digest/lib/digest.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/digest/lib/digest.rb, line 63
def file(name)
File.open(name, "rb") {|f|
buf = ""
while f.read(16384, buf)
update buf
end
}
self
end
Updates the digest with the contents of a given file name and returns self.