def TrimBytes(byte_string):
  """Trim leading zero bytes."""
 
  trimmed = byte_string.lstrip(b'\x00')
  if len(trimmed) == 0:  # was a string of all zero byte_string
    return b'\x00'
  else:
    return trimmed