Use hash to serialize data. fix #34.