def hex_8bit(value):
  """Converts 8bit value into bytearray.

  args:
    8bit value

  returns:
    bytearray of size 1
  """

  if value > 0xff or value < 0:
    raise Exception('Sar file 8bit value %s out of range' % value)
  return value.to_bytes(1, 'little')