[vorbis] Ogg checksum thingie needed
Nemo -earth native-
nemo at cheeky.house.cx
Wed Jan 7 21:26:16 PST 2004
On Thu, Jan 08, 2004 at 02:07:58AM +0100, Björn Lindström did utter:
>
> Two differently encoded Ogg:s should give different checksums, but the
> same file with different tags should give the same result.
>
> (The serial number doesn't work here, obviously. I need something that
> is changed if a bit of the file is lost.)
Might you be able to adapt spamsum to your purposes?
http://junkcode.samba.org/ftp/unpacked/junkcode/spamsum/README
It is a hash which is non-propogation - so a change of tags will only
affect a very small part of the output hash. It's also robust to
alignment changes - usefull if the two files have different length
comment blocks at the beginning.
I don't know how much different the serial number will make though...
(ok, so I'm curious now. I go test...
result: serial number differences are indeed enough to muss up spamsum.
My extremely basic test results are included below. imho, I think you're
gonna need some kind of ogg-aware checksum that can ignore serial
numbers and so on... maybe an oggdiff? ;)
.../Nemo
--
------------------------------------------ --------------------------
earth native
<p># with random serial numbers:
$ oggenc TheBeatles-Yesterday.wav -o output1.ogg
$ oggenc TheBeatles-Yesterday.wav -a "TheBeatles" -G "MelodicPopRock" -d
"196x" -t "Yesterday" -l"some beatles album the name of which escapes me
right now" -o output2.ogg
$ ls -o *.ogg
-rw-r--r-- 1 nemo 1744426 Jan 8 16:23 output1.ogg
-rw-r--r-- 1 nemo 1744570 Jan 8 16:23 output2.ogg
$ spamsum *.ogg
49152:82W2/HoEDSkohS14GAa6r4uxaBPfZU3+K:NWSoMC/rdUBPf9K
49152:RYc0p1bS5v5IwtR/mM9m6ikvrhk9QtVMQ:+cHIGVk6dzhk9DQ
# you can see the spamsum result are wildly different.
<p># with identical serial numbers, but differing comments still:
$ oggenc TheBeatles-Yesterday.wav -o output1.ogg -s 6
$ oggenc TheBeatles-Yesterday.wav -a "TheBeatles" -G "MelodicPopRock" -d
"196x" -t "Yesterday" -l"some beatles album the name of which escapes me
right now" -o output2.ogg -s 6
$ ls -o *.ogg
-rw-r--r-- 1 nemo 1744426 Jan 8 16:16 output1.ogg
-rw-r--r-- 1 nemo 1744570 Jan 8 16:17 output2.ogg
$ spamsum *.ogg
49152:MzkAq7SoPdFjid0QXnLIKCk80uD2w0F8W:Ak7jw5EKJDuD2gW
49152:czkAq7SoPdFjid0QXnLIKCk80uD2w0F8W:wk7jw5EKJDuD2gW
# you can see the spamsum result are almost identical, as expected
<p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis
mailing list