Perceptual image hashing in Perl