Revise CRC calls and use php's internal functions
This commit is contained in:
@@ -222,7 +222,7 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
$makedata = preg_replace('/0000/',sprintf('%04X',strlen($makedata)-14),$makedata,1);
|
||||
|
||||
/* EMSI crc16 */
|
||||
$makedata .= sprintf('%04X',$this->CRC16USD(substr($makedata,2)));
|
||||
$makedata .= sprintf('%04X',crc16(substr($makedata,2)));
|
||||
|
||||
return $makedata;
|
||||
}
|
||||
@@ -277,7 +277,7 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
sscanf(substr($str,strlen($str)-4),"%04X",$l);
|
||||
|
||||
/* Bad EMSI CRC */
|
||||
if ($l != ($x = $this->CRC16USD(substr($str,2,strlen($str)-6)))) {
|
||||
if ($l != ($x = crc16(substr($str,2,strlen($str)-6)))) {
|
||||
Log::error(sprintf('%s: ! Bad EMSI_DAT CRC: [%04X], should be: [%04X]!',__METHOD__,$l,$x));
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user