Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 55231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:20:42+00:00 2026-05-10T17:20:42+00:00

How to calculate CRC_B encoding in C# as described in ISO 14443? Here is

  • 0

How to calculate CRC_B encoding in C# as described in ISO 14443? Here is some background info:

CRC_B encoding This annex is provided for explanatory purposes and indicates the bit patterns that will exist in the physical layer. It is included for the purpose of checking an ISO/IEC 14443-3 Type B implementation of CRC_B encoding. Refer to ISO/IEC 3309 and CCITT X.25 2.2.7 and V.42 8.1.1.6.1 for further details. Initial Value = ‘FFFF’

  • Example 1: for 0x00 0x00 0x00 you should end up with CRC_B of 0xCC 0xC6
  • Example 2: for 0x0F 0xAA 0xFF you should end up with CRC_B of 0xFC 0xD1

I tried some random CRC16 libraries but they aren’t giving me the same results. I didn’t get the same results from online checks either like in here.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:20:42+00:00Added an answer on May 10, 2026 at 5:20 pm

    I reversed this from the C code in ISO/IEC JTC1/SC17 N 3497 so its not pretty but does what you need:

    public class CrcB {     const ushort __crcBDefault = 0xffff;      private static ushort UpdateCrc(byte b, ushort crc)     {             unchecked             {                 byte ch = (byte)(b^(byte)(crc & 0x00ff));                 ch = (byte)(ch ^ (ch << 4));                 return (ushort)((crc >> 8)^(ch << 8)^(ch << 3)^(ch >> 4));             }     }      public static ushort ComputeCrc(byte[] bytes)     {             var res = __crcBDefault;             foreach (var b in bytes)                     res = UpdateCrc(b, res);             return (ushort)~res;     } } 

    As a test, try the code below:

     public static void Main(string[] args)   {      // test case 1 0xFC, 0xD1      var bytes = new byte[] { 0x0F, 0xAA, 0xFF };      var crc = CrcB.ComputeCrc(bytes);      var cbytes = BitConverter.GetBytes(crc);       Console.WriteLine('First (0xFC): {0:X}\tSecond (0xD1): {1:X}', cbytes[0], cbytes[1]);       // test case 2 0xCC, 0xC6      bytes = new byte[] { 0x00, 0x00, 0x00 };      crc = CrcB.ComputeCrc(bytes);      cbytes = BitConverter.GetBytes(crc);      Console.WriteLine('First (0xCC): {0:X}\tSecond (0xC6): {1:X}', cbytes[0], cbytes[1]);        Console.ReadLine(); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer In a situation like that, I might see if there's… May 11, 2026 at 3:25 pm
  • added an answer The biggest problem with 64-bit is driver support. Vista 64-bit… May 11, 2026 at 3:25 pm
  • added an answer Not as far as I know. You could probably do… May 11, 2026 at 3:25 pm

Related Questions

How to calculate the length (in pixels) of a string in Java? Preferable without
How to calculate minute difference between two date-times in PHP?
Does anyone know how to calculate time difference in C++ in milliseconds? I used
There are some good examples on how to calculate word frequencies in C#, but

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.