- mb_convert_encoding: documentation ( source)
- bin2hex: documentation ( source)
- mb_detect_encoding: documentation ( source)
- sha1: documentation ( source)
- base64_encode: documentation ( source)
<?php
$concatString = "20161017T215257|580501e9f37ee|F3C0K54C|START_LOAN_DEMAND|123456|MS|5000000|0|104|CZK|||TV Samsung S25|15001|NESS|Navratil|Zdenek|604123456||zdenek.navratil@cofidis.cz|||||||||||http://www.myelectro.cz/callback.php";
$encod = mb_detect_encoding($concatString);
$utfString = mb_convert_encoding($concatString,"UTF-8",$encod);
$hashTag = sha1($utfString,true);
echo $hashTag;
echo "\r\n";
$base64Tag = base64_encode($hashTag);
echo $base64Tag;
echo "\r\n";
$forTriple = bin2hex(mb_convert_encoding($base64Tag,"UTF-8"));
echo $forTriple;
echo "\r\n";