Guess what, turns out what I needed was to use double quotes instead of single and both those hashes for '\x32\x45\xff\xca\x00\x00\x00\x01'
are incorrect.
so
echo hash_hmac('sha1', "\x32\x45\xff\xca\x00\x00\x00\x01", 'secret')."\n";
echo hash_hmac('sha1', "\x32\x45\xff\xca".pack("N",1), 'secret')."\n";
gives the correct thing
cde1e3710b6265b77fd4ac84293e20d981e92a6a
cde1e3710b6265b77fd4ac84293e20d981e92a6a
Subtle but true, test it out here