nodejs toBytes and fromBytes conversion