def write_uint8(data, value, index):
    """ Write 8bit value into data string at index and return new string """
    data = data.decode('utf-8')
    return '{}{:02x}{}'.format(data[:index * 2], value, data[index * 2 + 2:])
