Skip to main content
CRC Calc

CRC-16 / OPENSAFETY-B

Width16-bitRefInNoRefOutNo

Need custom parameters? Open in full calculator

Standard test string

Result

0x20FE

Similar CRC Algorithms

Result is calculated from the current input. Check is the published verification value for the standard input 123456789. Click another algorithm to view its detail page.

CRC Lookup Table

0x00000x755B0xEAB60x9FED0xA0370xD56C0x4A810x3FDA0x35350x406E0xDF830xAAD80x95020xE0590x7FB40x0AEF
0x6A6A0x1F310x80DC0xF5870xCA5D0xBF060x20EB0x55B00x5F5F0x2A040xB5E90xC0B20xFF680x8A330x15DE0x6085
0xD4D40xA18F0x3E620x4B390x74E30x01B80x9E550xEB0E0xE1E10x94BA0x0B570x7E0C0x41D60x348D0xAB600xDE3B
0xBEBE0xCBE50x54080x21530x1E890x6BD20xF43F0x81640x8B8B0xFED00x613D0x14660x2BBC0x5EE70xC10A0xB451
0xDCF30xA9A80x36450x431E0x7CC40x099F0x96720xE3290xE9C60x9C9D0x03700x762B0x49F10x3CAA0xA3470xD61C
0xB6990xC3C20x5C2F0x29740x16AE0x63F50xFC180x89430x83AC0xF6F70x691A0x1C410x239B0x56C00xC92D0xBC76
0x08270x7D7C0xE2910x97CA0xA8100xDD4B0x42A60x37FD0x3D120x48490xD7A40xA2FF0x9D250xE87E0x77930x02C8
0x624D0x17160x88FB0xFDA00xC27A0xB7210x28CC0x5D970x57780x22230xBDCE0xC8950xF74F0x82140x1DF90x68A2
0xCCBD0xB9E60x260B0x53500x6C8A0x19D10x863C0xF3670xF9880x8CD30x133E0x66650x59BF0x2CE40xB3090xC652
0xA6D70xD38C0x4C610x393A0x06E00x73BB0xEC560x990D0x93E20xE6B90x79540x0C0F0x33D50x468E0xD9630xAC38
0x18690x6D320xF2DF0x87840xB85E0xCD050x52E80x27B30x2D5C0x58070xC7EA0xB2B10x8D6B0xF8300x67DD0x1286
0x72030x07580x98B50xEDEE0xD2340xA76F0x38820x4DD90x47360x326D0xAD800xD8DB0xE7010x925A0x0DB70x78EC
0x104E0x65150xFAF80x8FA30xB0790xC5220x5ACF0x2F940x257B0x50200xCFCD0xBA960x854C0xF0170x6FFA0x1AA1
0x7A240x0F7F0x90920xE5C90xDA130xAF480x30A50x45FE0x4F110x3A4A0xA5A70xD0FC0xEF260x9A7D0x05900x70CB
0xC49A0xB1C10x2E2C0x5B770x64AD0x11F60x8E1B0xFB400xF1AF0x84F40x1B190x6E420x51980x24C30xBB2E0xCE75
0xAEF00xDBAB0x44460x311D0x0EC70x7B9C0xE4710x912A0x9BC50xEE9E0x71730x04280x3BF20x4EA90xD1440xA41F

CRC Source Code

/* 
 * Model: CRC-16 / OPENSAFETY-B (16-bit)
 * Poly: 0x755B, Init: 0x0000, XorOut: 0x0000
 * CRC Table C Source Code & Lookup Table Generator
 */
#include <stdint.h>
#include <stddef.h>

const uint16_t crc_table[256] = {
  0x0000, 0x755B, 0xEAB6, 0x9FED, 0xA037, 0xD56C, 0x4A81, 0x3FDA, 
  0x3535, 0x406E, 0xDF83, 0xAAD8, 0x9502, 0xE059, 0x7FB4, 0x0AEF, 
  0x6A6A, 0x1F31, 0x80DC, 0xF587, 0xCA5D, 0xBF06, 0x20EB, 0x55B0, 
  0x5F5F, 0x2A04, 0xB5E9, 0xC0B2, 0xFF68, 0x8A33, 0x15DE, 0x6085, 
  0xD4D4, 0xA18F, 0x3E62, 0x4B39, 0x74E3, 0x01B8, 0x9E55, 0xEB0E, 
  0xE1E1, 0x94BA, 0x0B57, 0x7E0C, 0x41D6, 0x348D, 0xAB60, 0xDE3B, 
  0xBEBE, 0xCBE5, 0x5408, 0x2153, 0x1E89, 0x6BD2, 0xF43F, 0x8164, 
  0x8B8B, 0xFED0, 0x613D, 0x1466, 0x2BBC, 0x5EE7, 0xC10A, 0xB451, 
  0xDCF3, 0xA9A8, 0x3645, 0x431E, 0x7CC4, 0x099F, 0x9672, 0xE329, 
  0xE9C6, 0x9C9D, 0x0370, 0x762B, 0x49F1, 0x3CAA, 0xA347, 0xD61C, 
  0xB699, 0xC3C2, 0x5C2F, 0x2974, 0x16AE, 0x63F5, 0xFC18, 0x8943, 
  0x83AC, 0xF6F7, 0x691A, 0x1C41, 0x239B, 0x56C0, 0xC92D, 0xBC76, 
  0x0827, 0x7D7C, 0xE291, 0x97CA, 0xA810, 0xDD4B, 0x42A6, 0x37FD, 
  0x3D12, 0x4849, 0xD7A4, 0xA2FF, 0x9D25, 0xE87E, 0x7793, 0x02C8, 
  0x624D, 0x1716, 0x88FB, 0xFDA0, 0xC27A, 0xB721, 0x28CC, 0x5D97, 
  0x5778, 0x2223, 0xBDCE, 0xC895, 0xF74F, 0x8214, 0x1DF9, 0x68A2, 
  0xCCBD, 0xB9E6, 0x260B, 0x5350, 0x6C8A, 0x19D1, 0x863C, 0xF367, 
  0xF988, 0x8CD3, 0x133E, 0x6665, 0x59BF, 0x2CE4, 0xB309, 0xC652, 
  0xA6D7, 0xD38C, 0x4C61, 0x393A, 0x06E0, 0x73BB, 0xEC56, 0x990D, 
  0x93E2, 0xE6B9, 0x7954, 0x0C0F, 0x33D5, 0x468E, 0xD963, 0xAC38, 
  0x1869, 0x6D32, 0xF2DF, 0x8784, 0xB85E, 0xCD05, 0x52E8, 0x27B3, 
  0x2D5C, 0x5807, 0xC7EA, 0xB2B1, 0x8D6B, 0xF830, 0x67DD, 0x1286, 
  0x7203, 0x0758, 0x98B5, 0xEDEE, 0xD234, 0xA76F, 0x3882, 0x4DD9, 
  0x4736, 0x326D, 0xAD80, 0xD8DB, 0xE701, 0x925A, 0x0DB7, 0x78EC, 
  0x104E, 0x6515, 0xFAF8, 0x8FA3, 0xB079, 0xC522, 0x5ACF, 0x2F94, 
  0x257B, 0x5020, 0xCFCD, 0xBA96, 0x854C, 0xF017, 0x6FFA, 0x1AA1, 
  0x7A24, 0x0F7F, 0x9092, 0xE5C9, 0xDA13, 0xAF48, 0x30A5, 0x45FE, 
  0x4F11, 0x3A4A, 0xA5A7, 0xD0FC, 0xEF26, 0x9A7D, 0x0590, 0x70CB, 
  0xC49A, 0xB1C1, 0x2E2C, 0x5B77, 0x64AD, 0x11F6, 0x8E1B, 0xFB40, 
  0xF1AF, 0x84F4, 0x1B19, 0x6E42, 0x5198, 0x24C3, 0xBB2E, 0xCE75, 
  0xAEF0, 0xDBAB, 0x4446, 0x311D, 0x0EC7, 0x7B9C, 0xE471, 0x912A, 
  0x9BC5, 0xEE9E, 0x7173, 0x0428, 0x3BF2, 0x4EA9, 0xD144, 0xA41F
};

uint16_t calculate_crc(const uint8_t *data, size_t length) {
    uint16_t crc = 0x0000;
    for (size_t i = 0; i < length; i++) {
        #if 0
        uint8_t idx = (uint8_t)(crc ^ data[i]);
        crc = (crc >> 8) ^ crc_table[idx];
        #else
        uint8_t idx = (uint8_t)((crc >> 8) ^ data[i]);
        crc = (crc << 8) ^ crc_table[idx];
        #endif
    }
    return crc ^ 0x0000;
}

About CRC-16/OPENSAFETY-B

CRC-16/OPENSAFETY-B complements OPENSAFETY-A with a different polynomial.

CRC-16/OPENSAFETY-B is a 16-bit CRC model defined by polynomial 0x755B, an initial register value of 0x0000, and final XOR 0x0000. It uses normal, non-reflected input and output processing.

Documented application context for this model includes openSAFETY, Industrial safety, Fieldbus. The calculator above applies this exact parameter set to the current input; the published Check value below is instead the fixed verification result for ASCII 123456789.

Standard test vector

CRC implementations are commonly verified with the ASCII input 123456789.

Input format
ASCII
Input
123456789
Expected CRC
0x20FE
Residue
0x0000

Model characteristics

A model is identified by its complete parameter set, not its polynomial alone.

Bit order
Normal
Register start
0x0000
Final XOR
0x0000
Published check
0x20FE

Implementation checks for CRC-16/OPENSAFETY-B

  • Use a 16-bit register and polynomial 0x755B.
  • Initialize the register to 0x0000 and use XorOut 0x0000 exactly as listed; changing either value defines a different model.
  • Verify the implementation with ASCII “123456789”; the expected result is 0x20FE.

Continue with the main calculator, browse the algorithm catalog, compare models in the Algorithm Reference section, or generate a lookup table.

Complete CRC-16/OPENSAFETY-B parameters

CRC parameter guide
ParameterValueMeaningReference
Width16 bitsCRC register and result widthRead guide
Poly0x755BGenerator polynomial without the leading termRead guide
Init0x0000Initial CRC register valueRead guide
RefInNoReflect each input byte before processingRead guide
RefOutNoReflect the register before XOR OutRead guide
XorOut0x0000Final value XORed with the CRC registerRead guide
Check0x20FECRC of ASCII “123456789”Read guide
Residue0x0000Expected residue after appending a valid CRCRead guide
AliasesopenSAFETY B

Where CRC-16/OPENSAFETY-B is used

  • 01openSAFETY
  • 02Industrial safety
  • 03Fieldbus

CRC-16/OPENSAFETY-B FAQ

What is the check value for CRC-16/OPENSAFETY-B?

For the standard ASCII test input 123456789, the check value of CRC-16/OPENSAFETY-B is 0x20FE.

What polynomial does CRC-16/OPENSAFETY-B use?

CRC-16/OPENSAFETY-B uses the 16-bit polynomial 0x755B.

Does CRC-16/OPENSAFETY-B use reflected input and output?

For CRC-16/OPENSAFETY-B, RefIn is No and RefOut is No.

What is CRC-16/OPENSAFETY-B commonly confused with?

The closest published model by parameter overlap is CRC-16/DECT-X, differing from CRC-16/OPENSAFETY-B in polynomial.