use uint in byteswapping routines to sync with rust internals