MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / Parity32

Method Parity32

SGSNGGSN/LLC.cpp:675–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675Parity32::Parity32(uint32_t generator, unsigned width, bool invertFirst)
676{
677 mMask = (((uint32_t)1<<width) - 1);
678 mInitialRemainder = invertFirst ? mMask : 0;
679 // If it is a 32-bit generator, dont bother passing in bit 33,
680 // which gets shifted off the top of the 32-bit generator argument.
681 if (width == 32) {
682 // untested: The 33rd bit is off the top, so put it back.
683 // Note that this would work for both cases, but clearer to separate it.
684 mInvertedGenerator = (revbits(generator,32) >> 1) | (1<<31);
685 } else {
686 mInvertedGenerator = revbits(mMask & generator,24);
687 }
688 genParityTab(mInvertedGenerator,mTab);
689}
690
691uint32_t Parity32::computeCrc(unsigned char *str, int len)
692{

Callers

nothing calls this directly

Calls 2

revbitsFunction · 0.85
genParityTabFunction · 0.85

Tested by

no test coverage detected