Return the integer stored in the specified node.

        Any type of integer will be decoded: byte, short, long, long long
342503
def int(self, *args):
        
        data = self.bytes(*args)
        if data is not None:
            if len(data) == 1:
                return struct.unpack("<B", data)[0]
            if len(data) == 2:
                return struct.unpack("<H", data)[0]
            if len(data) == 4:
                return struct.unpack("<L", data)[0]
            if len(data) == 8:
                return struct.unpack("<Q", data)[0]
            print("can't get int from %s" % hexdump(data))
1293146
public static int decodeInt(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            int value = (src[srcOffset] << 24) | ((src[srcOffset + 1] & 0xff) << 16) |
                ((src[srcOffset + 2] & 0xff) << 8) | (src[srcOffset + 3] & 0xff);
            return value ^ 0x80000000;
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
275290
public Long getInteger(int key) {
        PebbleTuple tuple = getTuple(key, PebbleTuple.TupleType.INT);
        if (tuple == null) {
            return null;
        }
        return (Long) tuple.value;
    }
477950
private int getByte(int position) {
    if (position + 1 >= length) {
      throw new IllegalStateException("Malformed DN: " + dn);
    }

    int b1, b2;

    b1 = chars[position];
    if (b1 >= '0' && b1 <= '9') {
      b1 = b1 - '0';
    } else if (b1 >= 'a' && b1 <= 'f') {
      b1 = b1 - 87; // 87 = 'a' - 10
    } else if (b1 >= 'A' && b1 <= 'F') {
      b1 = b1 - 55; // 55 = 'A' - 10
    } else {
      throw new IllegalStateException("Malformed DN: " + dn);
    }

    b2 = chars[position + 1];
    if (b2 >= '0' && b2 <= '9') {
      b2 = b2 - '0';
    } else if (b2 >= 'a' && b2 <= 'f') {
      b2 = b2 - 87; // 87 = 'a' - 10
    } else if (b2 >= 'A' && b2 <= 'F') {
      b2 = b2 - 55; // 55 = 'A' - 10
    } else {
      throw new IllegalStateException("Malformed DN: " + dn);
    }

    return (b1 << 4) + b2;
  }
12745
def get_byte_length(self, decoded=True) -> int:
        
        end = len(self.decoded_bits) if decoded else len(self.__plain_bits)
        end = self.convert_index(end, 0, 2, decoded=decoded)[0]
        return int(end)
1001499
def read_byte_as_integer(bytelen)
      unless bit_pointer % 8 == 0
        raise BinaryException.new("Bit pointer must be pointing start of byte. " +
                                  "But now pointing #{bit_pointer}.")
      end
      if self.length - bit_pointer/8 < bytelen
        raise BinaryException.new("Rest of self length(#{self.length - bit_pointer/8}byte) " + 
                                  "is shorter than specified byte length(#{bytelen}byte).")
      end
      response = 0
      bytelen.times do |i|
        response = response << 8
        response += to_i(bit_pointer/8 + i)
      end
      bit_pointer_inc(bytelen * 8)
      return response
    end
177405
def variable_length_int(i):
    
    if not isinstance(i, (int,long)):
        raise Exception('i must be an integer')

    if i < (2**8-3):
        return chr(i) # pack the integer into one byte
    elif i < (2**16):
        return chr(253) + struct.pack('<H', i) # pack into 2 bytes
    elif i < (2**32):
        return chr(254) + struct.pack('<I', i) # pack into 4 bytes
    elif i < (2**64):
        return chr(255) + struct.pack('<Q', i) # pack into 8 bites
    else:
        raise Exception('Integer cannot exceed 8 bytes in length.')
841264
function getBytes(node) {
    var text = getText(node);
    return text ? ByteUtils.arrayToBuffer(ByteUtils.base64ToBytes(text)) : undefined;
}
755907
def read_int(self):
		
		if self.reader.sysinfo.ProcessorArchitecture == PROCESSOR_ARCHITECTURE.AMD64:
			return int.from_bytes(self.read(8), byteorder = 'little', signed = True)
		else:
			return int.from_bytes(self.read(4), byteorder = 'little', signed = True)
145892
def _eval_num(self, node):
        
        if self.floats:
            return node.n
        else:
            return int(node.n)
764189
static int getInt(byte[] buffer, int offset) {
        return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16 | (buffer[offset + 2] & 0xff) << 8
                | (buffer[offset + 3] & 0xff);
    }
511026
def value(self) -> Optional[int]:
        
        if self.symbolic:
            return None
        assert isinstance(self.raw, z3.BitVecNumRef)
        return self.raw.as_long()
868253
def _get_node(self):
        """"""
        data = self.meta.read(self.node_size)
        return PFSNode(data, self.endianness)
832223
def _decode_ints(message):
    
    binary = base64.b64decode(message)
    return struct.unpack('<' + ('i' * (len(binary) // 4)), binary)
1135271
def _get(self, node, key):
        
        node_type = self._get_node_type(node)

        if node_type == NODE_TYPE_BLANK:
            return BLANK_NODE

        if node_type == NODE_TYPE_BRANCH:
            # already reach the expected node
            if not key:
                return node[-1]
            sub_node = self._decode_to_node(node[key[0]])
            return self._get(sub_node, key[1:])

        # key value node
        curr_key = without_terminator(unpack_to_nibbles(node[0]))
        if node_type == NODE_TYPE_LEAF:
            return node[1] if key == curr_key else BLANK_NODE

        if node_type == NODE_TYPE_EXTENSION:
            # traverse child nodes
            if starts_with(key, curr_key):
                sub_node = self._decode_to_node(node[1])
                return self._get(sub_node, key[len(curr_key):])
            else:
                return BLANK_NODE
319367
def byteToInt(byte):
    
    if hasattr(byte, 'bit_length'):
        # This is already an int
        return byte
    return ord(byte) if hasattr(byte, 'encode') else byte[0]
590544
def parse_node(node):
    
    if node is None or node == b'':
        raise InvalidNode("Blank node is not a valid node type in Binary Trie")
    elif node[0] == BRANCH_TYPE:
        if len(node) != 65:
            raise InvalidNode("Invalid branch node, both child node should be 32 bytes long each")
        # Output: node type, left child, right child
        return BRANCH_TYPE, node[1:33], node[33:]
    elif node[0] == KV_TYPE:
        if len(node) <= 33:
            raise InvalidNode("Invalid kv node, short of key path or child node hash")
        # Output: node type, keypath: child
        return KV_TYPE, decode_to_bin_keypath(node[1:-32]), node[-32:]
    elif node[0] == LEAF_TYPE:
        if len(node) == 1:
            raise InvalidNode("Invalid leaf node, can not contain empty value")
        # Output: node type, None, value
        return LEAF_TYPE, None, node[1:]
    else:
        raise InvalidNode("Unable to parse node")