"nar" computation checks can happen on files too.
This also deduplicates tests code on content and directory ones.
wip: because I still need to figure out some issues regarding file and "recursive"
output hash algo [1]
Related to T3781
Related to P1489