php 十六进制累加校验码

生成十六进制累加校验码

function getcheckcode($data){ if($data){ $arr = array(); $arr = str_split($data, 2); $result = 0; for ($i=0; $i < count($arr); $i++) { $result =$result + hexdec($arr[$i]); } $result = strtoupper('0'.dechex($result)); //转换成大写 return $result; } }

六月七
请先登录后发表评论
  • latest comments
  • 总共0条评论