ISO 8583 C Library (v0.0.3) – Benchmarks

The latest version includes a pack/unpack benchmarking module, along with sample MSVC 6.0 project files. The benchmark test is the same as the one published by jPOS.

The benchmarks were run on a Dell Inspiron 6000 laptop (Intel Pentium M – 2.00GHz).

In ‘Static Memory’ mode it is possible to perform in excess of 130,000 pack/unpack operations per second, as shown by the following screenshot: 

Benchmark (Static Memory)

 The throughput in ‘Dynamic Memory’ mode is lower but still manages just under 100,000 pack/unpack operations per second, as shown by the following screenshot:

Benchmark (Dynamic Memory)

See the ISO 8583 page for more details…


  1. radads says:

    Thanks for this nice software.
    One of the best, if not the only one, out there.
    Really helps understand ISO8583.

  2. Ahmad says:

    I can’t believe it, we are not alone and there are people who do care about ISO 8583!
    great work man, hope you don’t mind adding some changes (for EMV, security and dynamic simulation) on your program and re-posting it on your site.

    I hope you could consider NDC as well as part of your projects

  3. Kas says:

    This s/w is really gud.

    But there is one problem I am not getting thru..

    I tried ur demo.c with following ISO message, I am able to see the dump befor packing … but unpacking gives no output dump..
    Was checking the code with the values, that Jpos gives in it website for lightweight C library..

    URL :-

    (void)DL_ISO8583_MSG_SetField_Str(70,”BLAH BLAH”,&isoMsg);

    There is another doubt regarding primary bitmap… when we call the function :

    (void)DL_ISO8583_MSG_SetField_Str(0,”0800″,&isoMsg); /* from demo.c */

    Then what is it exactly doing … fillling up the MTI or Bitmap…

    i I understand that other calls are filling up the individual fields… but how is MTI and bitmap handled is pretty much unclear to me..

    I will really appreciate if u clear my doubts…

  4. Oscar says:


    The issue is caused by the following line of code from your example:

    (void)DL_ISO8583_MSG_SetField_Str(70,”BLAH BLAH”,&isoMsg);

    This is because Field #70 is defined as N(3) in both the 1987 and 1993 versions, so the Pack fails with an error.

    The basic example in demo.c is not checking for any errors, so the cause of the error isn’t obvious.

    The MTI is set by setting a value for Field 0, so the following code is setting the MTI to ‘0800’:


    As for the Bitmap, this is done automatically when you Pack the ISO message. If you look in the ‘DL_ISO8583_MSG_Pack’ function, you’ll see that a field is packed if it is set or if the field type corresponds to a Bitmap.

  5. Kas says:

    Hi Oscar,

    thx for the explaination… I am now able to figure out how the bitmap field is handled in your code. But now few more ?s arises before me and I strongly believe there is no better person than u to answer my queries ..

    I am new to ISO 8583 standard and therefore have own array of ?s:

    1. MTI size is 4 bytes fixed but Hexdump is simply printing ‘0800’ shouldn’t it be smthing like ‘00000808’

    2. I am seeing that bitmap is correctly encoded to my knowledge, but filed #2 is again not visible in proper hexdum format.
    It is simply printed as “15 04 54 00 00 00 00 00 03 ” … is here 15 is the length and 0 and 4 in ’04’ are representing 1 byte.
    If that is so, why is Bitmap printed differently.

    3. In some places u have left a comment for print, if required.
    What to do if I want to see the bitmap field output at the time it is being packed.

    4. In Unpack function, code is written to unpack bitmap, but what I could grasp is that other fields are being unpacked by checking the “len” value… or is it that unpacking is done based on the bitmap field … may b I m not getting the correct place to look into code..

    5. Can I use this library to pack/unpack the ISO 8583 message with Amex platform?

    I am really hoping to get my queries answered … and thx once again for clearing my doubts.. ur code rocks !!

  6. Dragomir says:

    If I use the lib in multithreaded environment – e.g. using it in multiple threads simultanuasly with multiple handles will be ok? Great lib, thanks Oscar!

  7. Daniel Craig says:

    Hello, I was looking around for a while searching for iso and I happened upon this site and your post regarding ISO 8583 C Library (v0.0.3) – Benchmarks, I will definitely this to my iso bookmarks!

  8. Oscar says:


    The library works fine in a multi-threaded environment, just make sure that your project is configured to compile with the relevant thread-safe libraries (for ‘memcpy’ and others).

    You can share the ISO-8583 Handler structure (DL_ISO8583_HANDLER) between the threads if you want, so long as all threads use the same handler and you initialise it before the threads, as the handler is read-only following initialisation.

    All you have to do is ensure that each of the threads have their own ISO-8583 Message structures (DL_ISO8583_MSG).

    For optimal performance use Static memory mode, to minimise memory management / fragmentation. Just ensure that the static buffer is private to each thread.

  9. Leon says:

    Hello Oscar,
    I just want to say that you did excellent work..
    But I have one question..
    when I want to set field number 12 (Time local transaction hhmmss,
    (void)DL_ISO8583_MSG_SetField_Str(12,”174852″,&isoMsg); which have 6 character representation, why I see 6 nulls in hex output before right value ? And after when i output the result i have
    [012] 000000174852 instead [012] 174852 ?
    I hope you understand my question, if not I will post every changes I made..
    Thx a lot.

  10. Oscar says:


    Field 12 is defined differently in the 1987 and 1993 versions, in the later it’s defined as Date / Time (i.e. 12 characters).

    Maybe you’re using the 1993 handler (DL_ISO8583_DEFS_1993_GetHandler) instead of the 1987 one (DL_ISO8583_DEFS_1987_GetHandler).

    If you think there is an issue then please email me further details…

  11. Haamed says:

    Hi friends (specially to Oscar),
    i am newbie in iso8583, i am writhing a program to send and give a ISO8583 pack with a channel manager, now my question is this ,
    could this c program connect to a server for sending and getting packages?
    or it just is for translation and i must add code for connecting to the server!
    if it could connect how should i change the code?

    thanks in advance for you help 😉

  12. Haamed says:

    ANd another thing is that…. how van i compile it on the linux ?!
    when i run gcc -c dll_iso8583.c or another i get eroor with compiling,
    it gets some error in code !

    please help me…

    thanks again

  13. Oscar says:


    The library is just for encoding/decoding ISO8583 messages, it doesn’t provide support for any communication channels.

    What type of communication channel do you need to support?

  14. Oscar says:


    Regarding the linux compilation… have you setup the environment variables correctly (i.e. PATH)?

    It’s generally easier to place all the source files in the same directory when compiling, otherwise you need to ensure that the compiler is aware of all of the different directories…

  15. Rajesh says:

    How do i send ASCII messages using the library without packing?
    Eg : 0200…… message hexdump should be
    30 32 30 30

  16. Oscar says:


    The current version only supports Binary encoding (ie packed). The next version will support both Display (ASCII/EBCDIC) and Binary encodings.

  17. Kribe says:

    Thank you for you software! It is valuable for me!

    I have some comments. Here are the first one. (Maybe I give more comments later.)

    You have in the function DL_ISO8583_MSG_Dump fully unnecessary line
    DL_ISO8583_FIELD_DEF *fieldDef = DL_ISO8583_GetFieldDef(i,iHandler);

    It can be erased because the fieldDef is not used anywhere.

    (File dl_iso8583.c)


    You have also in the loops complicated expressions which are repeated for every loop if your compiler in not capable to optimize it. Here is one example (file dl_iso8583.c):

    —– original —–

    DL_UINT16 fieldIdx;

    for ( fieldIdx=0 ; (fieldIdx<MIN(iHandler->fieldItems,kDL_ISO8583_MAX_FIELD_IDX+1)) && !err ; fieldIdx++ ) …

    — This is more efficient and clear ——

    DL_UINT16 fieldIdx, maxFieldIdx = MIN(iHandler->fieldItems,kDL_ISO8583_MAX_FIELD_IDX+1);

    for ( fieldIdx=0 ; (fieldIdx<maxFiledIdx) && !err ; fieldIdx++ ) …

    You also force the loop counter to have 16 bits. If you use plain “int” instead, you get more efficient code if your computer is not 16 bit computer.

  18. Kribe says:

    Not nice to get so much warnings:

    dl_iso8583.c: In function ‘DL_ISO8583_MSG_Dump’:
    dl_iso8583.c:278: warning: initialization discards qualifiers from pointer target type
    dl_iso8583_common.c: In function ‘_DL_ISO8583_MSG_AllocField’:
    dl_iso8583_common.c:64: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type
    dl_iso8583_fields.c: In function ‘_unpack_iso_ASCHEX’:
    dl_iso8583_fields.c:247: warning: passing argument 1 of ‘VarLen_Get’ from incompatible pointer type
    dl_iso8583_fields.c: In function ‘_unpack_iso_ASCII’:
    dl_iso8583_fields.c:342: warning: passing argument 1 of ‘VarLen_Get’ from incompatible pointer type
    dl_iso8583_fields.c: In function ‘_unpack_iso_BINARY’:
    dl_iso8583_fields.c:420: warning: passing argument 1 of ‘VarLen_Get’ from incompatible pointer type
    dl_output.c: In function ‘DL_OUTPUT_Hex’:
    dl_output.c:46: warning: initialization discards qualifiers from pointer target type
    dl_str.c: In function ‘DL_STR_GetEnv’:
    dl_str.c:48: warning: pointer type mismatch in conditional expression
    dl_str.c: In function ‘DL_STR_StrNDup’:
    dl_str.c:209: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type
    dl_str.c: In function ‘DL_STR_StrCat’:
    dl_str.c:243: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type
    dl_str.c: In function ‘DL_STR_EncapsulateStr’:
    dl_str.c:433: warning: passing argument 2 of ‘DL_MEM_malloc’ from incompatible pointer type

  19. Kazeem says:

    I have built your library with our point of sales source code, its working pretty fine. You save me a lot of work, more grease to your elbow. Keep it up.

  20. Angel Figueroa says:

    Can you ISO 8583 C Library be use in Objective-c language. I would like to use on a iphone application i am developing.

    Angel Figueroa

    • Oscar says:


      I’ve never used Objective-C myself, but according to the Objective-C writeup on wikipedia, it should be possible. It seems that at most you’ll just have to wrap the library with an Objective-C class.

      Let me know how it goes, sounds interesting…

  21. Angel Figueroa says:

    Thanks Oscar,

    I will make the Objective-C Class that wrapper you ISO 8583 Class in order that i can use from my iphone application.

    I will let you known my progress.

    Angel Figueroa

  22. Kribe says:

    Why so many people make unnecessary variables and substitute a value to them and immediately overwrite it with another value like you do:


    DL_ERR DL_ISO8583_MSG_SetField_Str ( DL_UINT16 iField,

    const DL_UINT8 *iDataStr,

    DL_ISO8583_MSG *ioMsg )

    DL_ERR err = kDL_ERR_NONE;

    err = DL_ISO8583_MSG_SetField_Bin(iField,




    return err;


    This is exactly same as:

    DL_ERR DL_ISO8583_MSG_SetField_Str ( DL_UINT16 iField,

    const DL_UINT8 *iDataStr,

    DL_ISO8583_MSG *ioMsg )

    return DL_ISO8583_MSG_SetField_Bin(iField,






    Anyway, thanks of your software. I use it in a real product.


  23. Rachid aitbrahim says:

    Thanks for this nice software. great work man,
    can you , give us , more example (Demo) for using this nice library

    Thanks Oscar

  24. kegan says:

    hello oscal and others;

    im new to iso 8583 and i want to use it in my EMV simulator project.. can somebody help me how to use it?.


  25. tech guy says:

    Hi Oscar,

    Great work!
    Any COM or wrapper for .NET? I’m eager to use this to my project.

    tech guy

  26. Hello,
    as I could not find way to upload these Makefiles for your software i have packaged and uploaded them to
    For unix users so they don’t need to think how to create them 🙂
    it by default compiles both demo and benchmark tools (all copyright is transfered to you by this message (and stated in readme file inside))

  27. Neeraj says:

    Hi Oscar,

    This is an example ISO network management message.

    Please please any body tell me how can i use this with this software.

  28. Brian says:

    Just a lighthearted “for-fun” comment: There is no ‘S’ in “The quick brown fox jumped over the lazy dog” (the sentence appears in field 62 in the screenshots at the top of the page).

  29. Downey says:

    Amazing. Thanks a lot.
    It just need a bit work to erase all the warnings under GCC.

  30. Axel says:

    Nice code, I am now using it on a VeriFone Vx570. I like it better than VeriFone’s own ACT ISO8583 library. Congrats

Leave a Reply

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.