As seen on fdb-apps, the most excellent freedb [1] project now has a thorough and useful how-to [2] available: "The howto covers freedb access, submit, disc ID generation, freedb file format, server protocol and much more." A sample algorithm for disc IDs is even included. Terrific documentation for a great project.
Links:
[1] http://freedb.org/
[2] http://freedb.org/sections.php?op=viewarticle&artid=27