How can I write this code by php and get similar results?
Build MSG for SHA calc
MSG_TXT = "8F"+"08"+"1234567890123470"+"08"+"1234567890123470"+"0743210987654321"+"08"
Convert MSG_TXT to MSG_BIN [] = {$8F,$08,$12,$34,$56, ..... $65,$43,$21,$08}
SHA-1(MSG_BIN[]) = 9E667331662BE10D78D56F75D6899F764212C5C1
this code is working in delphi but it's not working similar results in php
Try this:
// your string
$txt = "8F"."08"."1234567890123470"."08"."1234567890123470"."0743210987654321"."08";
// convert to binary string
$txt = pack('H*', $txt);
// print sha1
echo sha1($txt, false);