'Check hashes against the filestore.
Blobs use the hash in the schema:
aff4:/files/hash/generic/sha256/[sha256hash]
Args:
hashes: A list of Hash objects to check.
Yields:
Tuples of (RDFURN, hash object) that exist in the store.'

def CheckHashes(self, hashes):

    hash_map = {}
    for hsh in hashes:
        if hsh.HasField('sha256'):
            hash_map[aff4.ROOT_URN.Add('files/hash/generic/sha256').Add(str(hsh.sha256))] = hsh
    for metadata in aff4.FACTORY.Stat(list(hash_map), token=self.token):
        (yield (metadata['urn'], hash_map[metadata['urn']]))
