new version of computeHash(), without copy
path may be NULL
comment dead code