MDL-59961 core_files: make content hash validation reusable