implement encoder of A..Coding