Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. <?php
  2. # tmp.txtは `git cat-file -p <commit id>` の中身
  3. $contents = file_get_contents('tmp.txt');
  4.  
  5. $obj = sprintf("commit %d\0%s", strlen($contents), $contents);
  6. echo sha1($obj);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement