Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (28 sloc) 0.673 kb
f6378fe @brixen Added digests for tars and binaries.
brixen authored
1
2 def write_md5_digest_file(filename)
3 require 'digest/md5'
4 digest = Digest::MD5.new
5
6 File.open(filename, "rb") do |f|
7 until f.eof?
8 digest << f.read(1024)
9 end
10 end
11
12 digest_file = "#{filename}.md5"
13 File.open(digest_file, "w") do |f|
14 f.puts digest.hexdigest
15 end
16
17 puts "Computed MD5 to #{digest_file}"
18 end
19
20 def write_sha1_digest_file(filename)
21 require 'digest/sha1'
22 digest = Digest::SHA1.new
23
24 File.open(filename, "rb") do |f|
25 until f.eof?
26 digest << f.read(1024)
27 end
28 end
29
30 digest_file = "#{filename}.sha1"
31 File.open(digest_file, "w") do |f|
32 f.puts digest.hexdigest
33 end
34
35 puts "Computed SHA1 to #{digest_file}"
36 end
Something went wrong with that request. Please try again.