mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/digest/lib/digest.rb (Digest::Base.file): open a file in binary
mode. suggested by Kazuhiro NISHIYAMA. [ruby-dev:29579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
af05fa6a40
commit
2043c39808
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Fri Sep 15 00:03:07 2006 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/digest/lib/digest.rb (Digest::Base.file): open a file in binary
|
||||
mode. suggested by Kazuhiro NISHIYAMA. [ruby-dev:29579]
|
||||
|
||||
Thu Sep 14 17:21:07 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* numeric.c (fix_mul): avoid bignum multiplication as far as
|
||||
|
|
|
@ -13,7 +13,7 @@ module Digest
|
|||
# # => "f02e3c85572dc9ad7cb77c2a638e3be24cc1b5bea9fdbb0b0299c9668475c534"
|
||||
def self.file(name)
|
||||
digest = self.new
|
||||
File.open(name) {|f|
|
||||
File.open(name, "rb") {|f|
|
||||
buf = ""
|
||||
while f.read(16384, buf)
|
||||
digest.update buf
|
||||
|
|
Loading…
Reference in a new issue