Refactor sha1 computation to private function