[HttpFoundation] moved file hash calculation to own method