add .hash function to hash arbitrary resources