# CRC16 **Repository Path**: vk47_admin/CRC16 ## Basic Information - **Project Name**: CRC16 - **Description**: 用php实现16进制/ASCII码的crc16的各种模式校验和 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 4 - **Created**: 2022-12-05 - **Last Updated**: 2022-12-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CRC16 #### 介绍 用php实现16进制/ASCII码的crc16的各种模式校验和 #### 使用说明 ``` $a = "112233445566778899AABBCCDDEEFF11"; // CRC-16/IBM printf("%x\n", $this->crc16($a,"hex", 0x8005, 0, 0, true, true)); // CRC-16/MAXIM printf("%x\n", $this->crc16($a,"hex", 0x8005, 0, 0xffff, true, true)); // CRC-16/USB printf("%x\n", $this->crc16($a,"hex", 0x8005, 0xffff, 0xffff, true, true)); // CRC-16/MODBUS printf("%x\n", $this->crc16($a,"hex", 0x8005, 0xffff, 0, true, true)); // CRC-16/CCITT printf("%x\n", $this->crc16($a,"hex", 0x1021, 0, 0, true, true)); // CRC-16/CCITT-FALSE printf("%x\n", $this->crc16($a,"hex", 0x1021, 0xffff, 0, false, false)); // CRC-16/X25 printf("%x\n", $this->crc16($a,"hex", 0x1021, 0xffff, 0xffff, true, true)); // CRC-16/XMODEM printf("%x\n", $this->crc16($a,"hex", 0x1021, 0, 0, false, false)); // CRC-16/DNP printf("%x\n", $this->crc16($a,"hex", 0x3d65, 0, 0xffff, true, true)); ```