Implemented encode functionality of value block tool.