Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DE-022 Point-of-Service data code - Bit tables feel misleading and perhaps are reflecting an endianess? #23

Open
marksalternewday opened this issue Feb 2, 2023 · 2 comments

Comments

@marksalternewday
Copy link

I found the tables confusing and attached a patch to reflect my changes. Happy to discuss if needed.

Although I revised the bit indicators I did not rearrange the 'rows' - for now at least :-)

Suggested_fix_to_PDC_tables___-Arrange_flags_to_match_hex_layouts(perhaps_row_order_is_n.patch

@marksalternewday marksalternewday changed the title DE-022 Point-of-Service data code - Bit tables feel misleading and perhaps are reflecting a endianess? DE-022 Point-of-Service data code - Bit tables feel misleading and perhaps are reflecting an endianess? Feb 2, 2023
@ar
Copy link
Member

ar commented Feb 3, 2023

Thank you for the patch Mark.

Interesting enough, this issue was raised by @barspi in parallel. It is indeed confusing in ISO-8583 v2003 spec.

This is the layout used by the ISO spec itself, so I think we'd add extra confusion if we change these values here.

What's probably wrong is the endianness of PosDataCode implementation. We are thinking about making its endianness configurable.

Bad thing is the spec isn't clear about the value of 'BIT 1'. I assumed bit 1's value was 1, bit 2 was 2, bit 3 was 4, BUT, if we take a look at how the ISO8583 message's bitmap is documented, perhaps the gentlemen at the ISO committee think bits work the other way around :)

@marksalternewday
Copy link
Author

For me, if the mapping matches - so that during debugging it is easy to compare to the spec - that would be good.

I can't guess how the ISO committee think ;-)

I was thinking that perhaps the conversion to/from bytes/bit could be left until pack/unpack instead of being done on each interaction, it might allow some speed gains (not that they are necessarily needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants