Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- # tmp.txtは `git cat-file -p <commit id>` の中身
- $contents = file_get_contents('tmp.txt');
- $obj = sprintf("commit %d\0%s", strlen($contents), $contents);
- echo sha1($obj);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement