Re: filename-md5 howto?
"Andrew Liebeskind" <[email protected]> Sun, 15 May 2005 21:40:17 -0400 (EDT)
| Newsgroups | gmane.comp.apache.mod-mp3 |
|---|---|
| Message-ID | <[email protected]> |
Harald Kapper said:
> hi
> I'm trying to get the md5-hashes for the filenames right in order to be
> able to
> call eg "song1.mp3" as a direkt stream from the client, but I seem unable
> to get
> the right md5-hashing I always get different hashes for the string
> containing
> the filename (eg. in php4 MD5("song1.mpe"); )
>
> any help appreciated.
>
> thank you in advance
> harald kapper / kapper.net
>
Harald,
Here's what I found to work in my shell scripts: use the absolute pathname
of the file, but without a terminating newline. I.e., I get it by using:
echo -n "/foo/bar/song1.mp3" | md5sum
If I omit the -n argument, then echo appends a newline and I get a md5
hash that doesn't match what mod_mp3 has.
Hope that does the trick.
Regards,
Andrew