implement encode_single
Merge pull request #2 from muayyad-alsadi/master

implement encode_single