core: check that from/to arguments are not NULL in base16/64 functions