How does Git compute file hashes?

Git prefixes the object with “blob “, followed by the length (as a
human-readable integer), followed by a NUL character

$ echo -e 'blob 14\0Hello, World!' | shasum
8ab686eafeb1f44702738c8b0f24f2567c36da6d

Source: http://alblue.bandlem.com/2011/08/git-tip-of-week-objects.html

Leave a Comment