fileDigest now implement inner hash functions

and small refactorings