Extract sha1 to a method.