# automatically generated by the FlatBuffers compiler, do not modify

# namespace: 

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class Identity(object):
    __slots__ = ['_tab']

    @classmethod
    def SizeOf(cls):
        return 176

    # Identity
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Identity
    def Uuid(self, j = None):
        if j is None:
            return [self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0 + i * 1)) for i in range(self.UuidLength())]
        elif j >= 0 and j < self.UuidLength():
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0 + j * 1))
        else:
            return None

    # Identity
    def UuidAsNumpy(self):
        return self._tab.GetArrayAsNumpy(flatbuffers.number_types.Uint8Flags, self._tab.Pos + 0, self.UuidLength())

    # Identity
    def UuidLength(self):
        return 16

    # Identity
    def UuidIsNone(self):
        return False

    # Identity
    def Pubkey(self, j = None):
        if j is None:
            return [self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(16 + i * 1)) for i in range(self.PubkeyLength())]
        elif j >= 0 and j < self.PubkeyLength():
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(16 + j * 1))
        else:
            return None

    # Identity
    def PubkeyAsNumpy(self):
        return self._tab.GetArrayAsNumpy(flatbuffers.number_types.Uint8Flags, self._tab.Pos + 16, self.PubkeyLength())

    # Identity
    def PubkeyLength(self):
        return 32

    # Identity
    def PubkeyIsNone(self):
        return False

    # Identity
    def DataHash(self, j = None):
        if j is None:
            return [self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(48 + i * 1)) for i in range(self.DataHashLength())]
        elif j >= 0 and j < self.DataHashLength():
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(48 + j * 1))
        else:
            return None

    # Identity
    def DataHashAsNumpy(self):
        return self._tab.GetArrayAsNumpy(flatbuffers.number_types.Uint8Flags, self._tab.Pos + 48, self.DataHashLength())

    # Identity
    def DataHashLength(self):
        return 64

    # Identity
    def DataHashIsNone(self):
        return False

    # Identity
    def Signature(self, j = None):
        if j is None:
            return [self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(112 + i * 1)) for i in range(self.SignatureLength())]
        elif j >= 0 and j < self.SignatureLength():
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(112 + j * 1))
        else:
            return None

    # Identity
    def SignatureAsNumpy(self):
        return self._tab.GetArrayAsNumpy(flatbuffers.number_types.Uint8Flags, self._tab.Pos + 112, self.SignatureLength())

    # Identity
    def SignatureLength(self):
        return 64

    # Identity
    def SignatureIsNone(self):
        return False


def CreateIdentity(builder, uuid, pubkey, dataHash, signature):
    builder.Prep(1, 176)
    for _idx0 in range(64 , 0, -1):
        builder.PrependUint8(signature[_idx0-1])
    for _idx0 in range(64 , 0, -1):
        builder.PrependUint8(dataHash[_idx0-1])
    for _idx0 in range(32 , 0, -1):
        builder.PrependUint8(pubkey[_idx0-1])
    for _idx0 in range(16 , 0, -1):
        builder.PrependUint8(uuid[_idx0-1])
    return builder.Offset()
