Created
January 23, 2014 02:14
-
-
Save MichaelEvans/8571631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/sha1' | |
tree = `git write-tree` | |
parent = `git rev-parse HEAD` | |
puts "Tree: #{tree}" | |
puts "Parent: #{parent}" | |
def test(start, tree, parent) | |
sha1 = "9403248290" | |
counter = start | |
while "0000001" < sha1[0..6] do | |
time = "1390424498" | |
content = "tree #{tree.strip} | |
parent #{parent.strip} | |
author CTF user <[email protected]> 1390424498 +0000 | |
committer CTF user <[email protected]> 1390424498 +0000 | |
Give me a Gitcoin | |
#{counter.to_s(16)} | |
" | |
header = "commit #{content.length}\0" | |
store = header + content | |
sha1 = Digest::SHA1.hexdigest(store) | |
#puts sha1 | |
# puts sha1 | |
# puts content | |
counter+=1 | |
# puts "#{counter} #{finish}" | |
# if counter % 10000 == 0 | |
# end | |
end | |
puts content | |
puts counter.to_s(16) | |
puts sha1 | |
end | |
test(230, tree, parent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment