Skip to main content


Please be aware that much of the software linked to or mentioned on this forum is niche and therefore infrequently downloaded. Lots of anti-virus scanners and so-called malware detectors like to flag infrequently downloaded software as bad until it is either downloaded enough times, or its developer actually bothers with getting each individual release allow listed by every single AV vendor. You can do many people a great favor when encountering such a "problem" example by submitting them to your AV vendor for examination. For almost everything on this forum, it is a false positive.
Topic: How-to: Copy the MD5 checksum to a tag and compare it (Read 386 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How-to: Copy the MD5 checksum to a tag and compare it

How to copy the built-in FLAC MD5 audio checksum to the Comment tag and verify that it matches, using Mp3tag.
This is primarily intended to be used for [prior to] conversions from FLAC to FLAC (usually changing compression levels) or from FLAC to any lossless format and back to FLAC. As long as the Comment tag is carried over through the conversions, you have the confirmation that the audio data stayed the same.

Step 0 (optional) - Display the MD5 checksum in a column:
1. Right click on the top of the columns, select "Customize columns..." and make a New column.
2. Name: MD5 and Value: %_md5audio%.
You should now see the MD5 values for all FLAC files.

Step 1 - Copy the MD5 checksum to the Comment tag:
1. Select the track(s).
2. Click on the "Tag - Tag" button in the toolbar.
3. Field: COMMENT and Format string: %comment% '['MD5: %_md5audio%']'.
This will add the checksum at the end of the existing comments/content, like [MD5: 42B36D5....].

Step 2 - Check if the built-in MD5 checksum is included in the Comment tag:
1. Make a New column.
2. Name: MD5 check. Value: $ifgreater($strstr(%comment%,%_md5audio%),0,OK,ERROR).
If the exact MD5 checksum of a file exists also in the Comment tag, the column will show OK, otherwise it will show ERROR. The matching is case-sensitive. If you have a big list of files you can sort by column to separate the OKs and the ERRORs.

That's it. So far it's been working as intended for me, but let me know if you encounter any problems or have any suggestions.
Using the Comment tag for this might be less than ideal, because there's often content there. OTOH it seems like a safe option that should work across various audio formats and software without breaking stuff.

Re: How-to: Copy the MD5 checksum to a tag and compare it

Reply #1
On using some other tag instead of the Comment... Apparently the FLAC (Vorbis) tagging system allows creating custom tags without breaking the FLAC format. So you could copy that MD5 data into your own custom tag, which could be called MD5CUSTOMTAG, for example.
In that case you might as well copy the MD5 value directly without any brackets and you can have a simpler formula in Mp3tag, like $if($eql(%MD5CUSTOMTAG%,%_md5audio%),OK,ERROR).

I converted such a FLAC to WavPack, MP3, AAC and Opus with Foobar and the custom tag was transferred as well and the files appear to work fine in a couple of Windows programs that I tried.
The only question is whether such files would work fine everywhere. I remember a case where a hardware MP3 player couldn't play MP3 files if they contained the disc number, for example, that's why I'm a bit careful.
But since the custom tag can be removed later, I think it's not a big deal. If someone knows more about this, let me know.

Re: How-to: Copy the MD5 checksum to a tag and compare it

Reply #2
TagScanner now also has a FLAC MD5 placeholder function. Here's how to copy that MD5 data to a new "custom" tag and make a comparison column.

Step 0 (optional) - Display the built-in MD5 data and your own new MD5-containing tag, each in its own column:
1. Right click -> Add Column.
2. Give it a Name and in Field/Pattern enter %_flac_md5%.
3. Make a column also for the new/custom tag. In the Field/Pattern enter, for example, %MD5TAG%.

Step 1 - Copy the MD5 checksum data for the selected FLAC file(s) to the new tag:
1. In the toolbar, click on "Format value from other fields...".
2. In Field, enter MD5TAG and in Pattern enter %_flac_md5%.

Step 2 - Verify that the two values match, using a new column with a function:
1. Create a new column, give it a name (like MD5-check) and in Field/Pattern enter $if($equal(%MD5TAG%,%_flac_md5%),OK,ERROR).
If the two fields match, you should see OK, otherwise it says ERROR. It says ERROR also if you haven't copied the MD5 data to the custom tag yet.

In the mean time, I also tried playing files with a custom tag like this (MD5TAG) in a few simple hardware players and there were no issues, even with MP3s. So I would recommend using this method instead of copying this data to the Comment tag or whatever. It's tidier and in the worst case you can still remove the tag.

SimplePortal 1.0.0 RC1 © 2008-2021