rewrite base library from binary to type converter style.

New version use []byte type conversion instead of binary.MarshalBinary/binary.UnmarshalBinary