I've been searching for a working algorithm for sha1 and finally the only working solution is by hoxsiew
Thank you!