Last active
August 29, 2015 14:03
-
-
Save leifericf/83f69fb1d631fcf55322 to your computer and use it in GitHub Desktop.
Revisions
-
Leif Eric Fredheim renamed this gist
Oct 30, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Leif Eric Fredheim revised this gist
Jun 27, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ def git_hash(file) data = File.read(file) size = data.bytesize.to_s Digest::SHA1.hexdigest('blob ' + size + "\0" + data) # Git's hashing algorithm end puts git_hash(ARGV[0]) -
Leif Eric Fredheim revised this gist
Jun 27, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ def git_hash(file) data = File.read(file) size = data.bytesize.to_s Digest::SHA1.hexdigest("blob " + size + "\0" + data) # Git's hashing algorithm end puts git_hash(ARGV[0]) -
Leif Eric Fredheim renamed this gist
Jun 27, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ def git_hash(file) data = File.read(file) size = data.bytesize.to_s Digest::SHA1.hexdigest("blob " + size + "\0" + data) # Git's hasing algorithm end puts git_hash(ARGV[0]) -
Leif Eric Fredheim created this gist
Jun 27, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #!/usr/bin/env ruby require 'digest/sha1' def git_hash(file) data = File.read(file) size = data.bytesize.to_s Digest::SHA1.hexdigest("blob " + size + "\0" + data) end puts git_hash(ARGV[0])