def METHOD_NAME(self):
    # Certain repos use "sha" to refer to "SHA-1", whereas in `hashlib`,
    # "sha" goes through OpenSSL and refers to a different digest.
    if self.algorithm == "sha":
        return hashlib.sha1()
    return hashlib.new(self.algorithm)