learning rust by implementing sha1. partially copied from other people