class to generate token codes