Image content identification systems have many applications in industry and academia. In particular, a hash-based content identification system uses a robust image hashing function that computes a short binary identifier summarizing the perceptual content in a picture and is invariant against a set of expected manipulations while being capable of differentiating between different pictures. A common approach to designing these algorithms is crafting a processing pipeline by hand. Unfortunately, once the context changes, the researcher may need to define a new function to adapt. A deep hashing approach exploits the feature learning capabilities in deep networks to generate a feature vector that summarizes the perceptual content in the image, achieving outstanding performance for the image retrieval task, which requires measuring semantic and perceptual similarity between items. However, its application to robust content identification systems is an open area of opportunity. Also, image hashing functions are valuable tools for image authentication. However, to our knowledge, its application to content-preserving manipulation detection for image forensics tasks is still an open research area. In this work, we propose a deep hashing method exploiting the metric learning capabilities in contrastive self-supervised learning with a new modular loss function for robust image hashing. Moreover, we propose a novel approach for content-preserving manipulation detection for image forensics through a sensitivity component in our loss function. We validate our method through extensive experimentation in different data sets and configurations, validating the generalization properties in our work.