migrate_hash_to_bin: simplify the usage of parameter
asprintf is provided by GNU extensions and *BSD