added method to crypto library for validating hashes.