change the utility functions to work on size_t instead of uint64_t for 32 bit portability