Skip to content

Instantly share code, notes, and snippets.

@kiborg
kiborg / sha1.php
Created February 19, 2018 23:19 — forked from natmchugh/sha1.php
Pure PHP implementation of SHA1from wikipedia pseudo code
<?php
/*
Note 1: All variables are unsigned 32 bits and wrap modulo 232 when calculating, except
ml the message length which is 64 bits, and
hh the message digest which is 160 bits.
Note 2: All constants in this pseudo code are in big endian.
Within each word, the most significant byte is stored in the leftmost byte position
*/