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): new method.
[ruby-dev:29572] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
29d0396012
commit
d6ff7b526a
2 changed files with 18 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Sep 14 14:37:45 2006 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/digest/lib/digest.rb (Digest::Base.file): new method.
|
||||||
|
[ruby-dev:29572]
|
||||||
|
|
||||||
Thu Sep 14 08:30:02 2006 Tanaka Akira <akr@fsij.org>
|
Thu Sep 14 08:30:02 2006 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/digest/digest.c (rb_digest_base_inspect): new method.
|
* ext/digest/digest.c (rb_digest_base_inspect): new method.
|
||||||
|
|
|
@ -5,4 +5,17 @@ module Digest
|
||||||
autoload "SHA256", "digest/sha2"
|
autoload "SHA256", "digest/sha2"
|
||||||
autoload "SHA384", "digest/sha2"
|
autoload "SHA384", "digest/sha2"
|
||||||
autoload "SHA512", "digest/sha2"
|
autoload "SHA512", "digest/sha2"
|
||||||
|
|
||||||
|
class Base
|
||||||
|
def self.file(name)
|
||||||
|
digest = self.new
|
||||||
|
File.open(name) {|f|
|
||||||
|
buf = ""
|
||||||
|
while f.read(16384, buf)
|
||||||
|
digest.update buf
|
||||||
|
end
|
||||||
|
}
|
||||||
|
digest
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue