While working on the Mandriva maintainer's database, one thing needed is an authentication token as a very basic safety precaution. I couldn't figure out why it wasn't working and it looks like PHP's message digest hashing is off. Has anyone ever seen this before? Here's a quick demo:

% echo rpmctl+openssh | md5sum
cb47e7b47a32e744e13c7deb7ad85aac  -
% echo rpmctl+openssh | openssl dgst -md5
% echo "< ?php print(hash('md5',"rpmctl+openssh") . '\n'); ? >"|php

md5sum and openssl's dgst command produce the same output. The odd-man-out here is PHP. And it's not just md5 either:

% echo rpmctl+openssh | openssl dgst -sha
% echo "rpmctl+openssh"|sha1sum
08ac3085dcad76af5b7fdc4397a848b9ed3f2300  -
% echo "< ?php print(hash('sha1',"rpmctl+openssh") . '\n'); ? >"|php
% echo "< ?php print(sha1("rpmctl+openssh") . '\n'); ? >"|php

Has anyone seen this before or have any idea of what the heck PHP is doing?

EDIT: Has anyone else noticed that re-editing a word press post completely farks the whole thing up? Geez!