add API to return used chars. Store max char code