1
if (crc & 0x8000){
  crc = crc << 1 ^ 0x1021;
}

Above code block is in C language. what would be the equivalent php code.

1 Answer 1

1

You can use bitwise operators and inline hex numbers in PHP just fine. The equivalent should just be:

if ($crc & 0x8000){
  $crc = $crc << 1 ^ 0x1021;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.