Generate a Perceptual Image Hash in Go

Perceptual hashing is defined as the use of an algorithm that produces a snippet or fingerprint of miscellaneous forms of multimedia. The functions of perceptual image hashing extract certain features from an image and calculate a hash value based on the information. Due to the unique ‘fingerprint’ of the hash value, it is often used in digital forensics or to detect online cases of copyright infringement.

In order to determine the hash value for an image, we have developed an API that will automatically generate the value for you. All you need to do is provide the image to perform the operation on, the recognition mode (optional — default is Normal) and the API key for the following code in Go:

package main

And that’s it! Process complete. To retrieve your personal API key, you can visit the Cloudmersive website and register for a free account; this will also give you access to 800 calls/month across our library of APIs.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.