refactor random
platform macro
bswap_16