make encode method to accept array of integers

hello, ivanakimov
This PR is try to make `encode` method to accept a group of integers, instead of passing it one by one. I hope it is helpful.