Key Token Format in API

Hi,
I have been building an integration between Fabman and the Paxton Net2 access control system so that we can fully control building access from Fabman with expired members automatically blocked. We are in a shared building with a lot of doors/gates and so using Fabman bridges for every door is impractical.

I have been banging my head against the wall with an issue over the format of Key Tokens from the API that I have just got to the bottom of as the solution was far from obvious.

I have now reverse engineered the following as the format for tokens on the Fabman API.
<2 characters of unknown purpose><2 characters of unknown purpose>

The Net2 system stores tokens as an unpadded decimal format. So to convert from the Fabman API value to what Net2 needs I have to strip off the 2 start and end characters and then perform a Hex to Dec conversion.

For example:
Scanning into a bridge a token with an ID of “0000976698”,
this comes across the API as “55000ee73a86”,
Stripping 2 characters off each end gives “000ee73a”,
Performing a Hex to Dec conversion gives “976698”, which is the format Net2 needs.

Could someone let me know what the end 2 characters are for as I am worried there is something crucially important about them?

Hey @MakerspaceAshfield,

I assume you are talking about em4102 tokens? The last 2 bytes are a checksum, which is reported by some (but not all) token readers. It’s simply a byte-wise xor of the other 5 bytes, padded to 2 hex digits.