def get_hash(self, data, hasher=None):
        if hasher is None:
            hasher = self.hasher
        if hasher is None:
            hasher = hashlib.md5
            prefix = ''
        else:
            hasher = getattr(hashlib, hasher)
            prefix = '%s=' % self.hasher
        digest = hasher(data).digest()
        digest = base64.urlsafe_b64encode(digest).rstrip(b'=').decode('ascii')
        return '%s%s' % (prefix, digest)
Get the hash of some data, using a particular hash algorithm, if
dataset/ETHPy150Open anzev/hedwig/build/pip/pip/_vendor/distlib/database.py/BaseInstalledDistribution.get_hash