Cookbook identifiers

Is there a way to generate individual cookbook identifier by a SHA-1 hash of the content outside of policyfiles. We have a use-case of non-prod and prod supermarkets where potentially same version of cookbook will exist. We need a way to ensure that the same version also has same content in both the supermarkets.