def check(self, name, data, digest):
        # test the direct constructors
        computed = getattr(hashlib, name)(data).hexdigest()
        self.assert_(computed == digest)
        # test the general new() interface
        computed = hashlib.new(name, data).hexdigest()
        self.assert_(computed == digest)