def hex_16bit(value):
  """Converts 16bit value into bytearray.

  args:
    16bit value

  returns:
    bytearray of size 2
  """

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