Skip to main content

Music file hasher

Project description

['mp3hash\n', '=======\n', '\n', 'Hashes music files ignoring meta-data.\n', '\n', 'Useful to detect the same song in different tagged files.\n', '\n', 'Use\n', '===\n', '\n', 'Similarly to ``sha1sum`` or ``md5sum``, it takes one or more files and\n', 'returns the hashes, in this way:\n', '\n', '::\n', '\n', ' $ ./mp3hash *.mp3\n', ' 6611bc5b01a2fc6a6386a871e8c51f86e1f12b33 13_Hotel-California-(Gipsy-Kings).mp3\n', ' 6611bc5b01a2fc6a6386a871e8c51f86e1f12b33 14_Hotel-California-(Gipsy-Kings).mp3\n', '\n', 'It returns the same hash number, even though the tags are different, and\n', 'so their regular hashes:\n', '\n', '::\n', '\n', ' $ sha1sum *.mp3\n', ' 6a1d5f8317add10e205ae30174630b47645fb5b4 13_Hotel-California-(Gipsy-Kings).mp3\n', ' c28d6976114d31df3366d9935eb0bedd36cf1f0b 14_Hotel-California-(Gipsy-Kings).mp3\n', '\n', "The hash it's made strictly using the music data in the file, by\n", 'calculating the tags sizes and omitting them.\n', '\n', 'The default hashing algorithm is ``sha-1``, but any algorithm can be\n', "used as long it's supported by the Python's ``hashlib`` module. A\n", 'complete list of all available hashing algorithms can be obtained by\n', 'calling the program with the ``--list-algorithms``.\n', '\n', '::\n', '\n', ' $ ./mp3hash --list-algorithms\n', ' md5\n', ' sha1\n', ' sha224\n', ' sha256\n', ' sha384\n', ' sha512\n', '\n', ' ./mp3hash --algorithm md5\n', ' ac0fdd89454528d3fbdb19942a2e6653 13_Hotel-California-(Gipsy-Kings).mp3\n', ' ac0fdd89454528d3fbdb19942a2e6653 14_Hotel-California-(Gipsy-Kings).mp3\n', '\n', 'Install\n', '=======\n', '\n', "It doesn't have any dependences besides ``python2.6+`` so you should be\n", 'able to run the script straight.\n', '\n', 'Technical details\n', '=================\n', '\n', 'Supported and ignored meta-data tags are: id3v1, id3v2 both in their\n', 'simple and indexed forms\n', '\n', 'About id3v1\n', '-----------\n', '\n', "- id3v1 is 128 bytes at the end of the file starting with 'TAG'\n", '- id3v1 extended is 227 bytes before regular id3v1 tag starting with\n', " 'TAG+'\n", '\n', 'total size: 128 + (227 if extended)\n', '\n', 'About id3v2\n', '-----------\n', '\n', '- id3v2 header have the following fields alog the 10 first bytes in the\n', ' file - byte 5 holds flags. 6th bit indicates extended tag - bytes\n', ' 6-10 are the tag size (not counting header)\n', '\n', '- id3v2 extended has a 10 bytes header after the regular id3v2 - bytes\n', ' 1-4 are the tag size (not counting header nor padding) - bytes 5-6\n', ' holds some flags. Leftmost bit indicates CRC presence - bytes 6-10\n', ' are the tag padding size (extra blank size within tag)\n', '\n', 'total size: 10 + tagsize + (10 + etagsize + padding if extended)\n', '\n', 'Based on id3v1 wikipedia docs: http://en.wikipedia.org/wiki/ID3 Based on\n', 'id3v2 docs: http://www.id3.org/id3v2.3.0\n']

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mp3hash-0.0.3.tar.gz (4.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page