def hset(self, hashkey, attribute, value):
        """Emulate hset."""

        redis_hash = self._get_hash(hashkey, 'HSET', create=True)
        attribute = self._encode(attribute)
        attribute_present = attribute in redis_hash
        redis_hash[attribute] = self._encode(value)
        return long(0) if attribute_present else long(1)