Skip to content

Commit

Permalink
doc: Some clarifications on iso8583 tutorial about the encoding of fi…
Browse files Browse the repository at this point in the history
…elds [ci skip]
  • Loading branch information
barspi committed Oct 8, 2014
1 parent 4eff270 commit b187e3e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doc/src/asciidoc/ch02/iso8583.asc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ ISO-8583 messages are composed by fields, which are represented in different way
|2 .. 128 |Other fields as specified in bitmap
|========================================================================

[NOTE]
The bitmaps are encoded in network byte order, with the most significant bit (leftmost bit) of the first
byte indicating presence of a secondary bitmap. Then, the next bit towards the right indicates presence
of field 2, the next one refers to field 3, and so on.



So let's have a look at a simple example:

.Sample 0800 message
Expand Down Expand Up @@ -161,7 +168,7 @@ Variable length fields have a prefix specifying its length, but how this is repr
is not defined. Different vendors use different representations (e.g., BCD, EBCDIC,
binary value).

In our example, field #3 is using a BCD representation, so a value of "000000"
In our example, field #3 is using a BCD representation in network byte order, so a value of "000000"
is represented with just three bytes whose hex values are "00 00 00".
Same goes for field #11 whose value is "000001" - it is represented as "00 00 01".
In our example, field #41 is an eight-byte alphanumeric field represented as eight ASCII characters
Expand Down Expand Up @@ -242,11 +249,13 @@ Secondary bitmap: 04000000 00000000
Field 03: 000000
Field 11: 000001
Field 41: 3239313130303031 (ASCII for "29110001")
Field 60: 0010 6A504F5320312E392E31 (length=10, value="jPOS 1.9.1")
Field 60: 0010 6A504F5320312E392E31 (length=10, value="jPOS 1.9.1") <1>
Field 70: 0301
----

<1> In this example, the length prefix in field 60 is expressed as a 2-byte BCD number; therefore, a length of 10 is encoded as 0010 in hexadecimal.

Let's break down this bitmap:

.Primary Bitmap
Expand Down Expand Up @@ -314,7 +323,7 @@ of +headers+.

A few of them (especially stream-based ones) require some kind of trailers as well.

So wire protocol is composed by:
So, the wire protocol is composed by:

* An optional header / message boundary delimiter
* ISO-8583 message data
Expand Down

0 comments on commit b187e3e

Please sign in to comment.