

def blob(self):
    res = bytearray()
    if (self.length > 62):
        res += bytes([(((self.code << 6) | 63) & 255), ((self.code << 6) >> 8)])
        res += bytes([(self.length & 255), ((self.length >> 8) & 255), ((self.length >> 16) & 255), ((self.length >> 24) & 255)])
    else:
        res += bytes([(((self.code & 3) << 6) | self.length), (self.code >> 2)])
    res += self.data
    return res

dataset/ETHPy150Open tailhook/pyzza/pyzza/tags.py Tag.blob/original