pack/unpack d/t from 5-byte buf