> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/namespaces/namespacesdi.md).

# sdi

[Namespaces](#namespaces) | [Data Structures](#nested-classes) | [Functions](#func-members)

|            |                                                                                                       |
| ---------- | ----------------------------------------------------------------------------------------------------- |
| Namespaces |                                                                                                       |
|            | [filesystem](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/namespacesdi_1_1filesystem.md) |

|                 |                                                                                                       |
| --------------- | ----------------------------------------------------------------------------------------------------- |
| Data Structures |                                                                                                       |
| struct          | [MD5\_CTX](#structsdi_1_1_m_d5___c_t_x)                                                               |
| class           | [SdiLanguage](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_sdi_language.md) |
| class           | [Timer](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_timer.md)              |
| class           | [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)     |

|                                                                                                   |                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Functions                                                                                         |                                                                                                                                                                                                                                                                             |
| int                                                                                               | [hextobin](#aa7fda2cc5788cacfc2e267534b6391cd) (unsigned char \*dst, const unsigned char \*src, int srclen)                                                                                                                                                                 |
| int                                                                                               | [hextobin](#a62d4f9a462bed89ebf473e377b7a24ad) (csd::csd\_data \&dst, const unsigned char \*src, int srclen)                                                                                                                                                                |
| void                                                                                              | [bintohex](#adb43cc15cc5e467d2a32db177abd95ac) (unsigned char \*dst, const unsigned char \*src, int srclen)                                                                                                                                                                 |
| void                                                                                              | [bintohexstring](#a451fd8059d3954678d5ad223175cb078) (char \*dst, const unsigned char \*src, int srclen)                                                                                                                                                                    |
| void                                                                                              | [bintohexstring](#a13312c8bd33a98c730b4c757e55a5304) (string \&dst, const unsigned char \*src, int srclen)                                                                                                                                                                  |
| void                                                                                              | [bintohexstring](#a6afe79e222ca1a9079f715b758dc4255) (csd\_string \&dst, const unsigned char \*src, int srclen)                                                                                                                                                             |
| void                                                                                              | [bintotrack2](#a8da4aa04db98292e03fb0c769642ac4e) (unsigned char \*dst, const unsigned char \*src, int srclen)                                                                                                                                                              |
| void                                                                                              | [bintotrack2string](#a86d21f7d6c1590dfd83b11e0228e6dc4) (csd\_string \&dst, const unsigned char \*src, int srclen)                                                                                                                                                          |
| int                                                                                               | [track2tobin](#ad7b26a90792d2c2e5486941ed7b4dd7c) (unsigned char \*dst, const unsigned char \*src, int srclen)                                                                                                                                                              |
| int                                                                                               | [track2tobin](#ae42d999b07e327fe3aea4bfe156cef0a) (csd::csd\_data \&dst, const unsigned char \*src, int srclen)                                                                                                                                                             |
| void                                                                                              | [bintohexstring](#a5e63c92e42e60c105bf33ec9734ccc6f) (std::string \&dst, const unsigned char \*src, int srclen)                                                                                                                                                             |
| void                                                                                              | [bintohexstring](#a36bdbba7b034d5eca9058f51ae40bfd1) (csd::csd\_string \&dst, const unsigned char \*src, int srclen)                                                                                                                                                        |
| void                                                                                              | [bintotrack2string](#a8836d3db59a0107a55d45c6726967973) (csd::csd\_string \&dst, const unsigned char \*src, int srclen)                                                                                                                                                     |
| void                                                                                              | [MD5Init](#a08e47999152d737f33fda2b8729c4f7c) ([MD5\_CTX](#structsdi_1_1_m_d5___c_t_x) \*context)                                                                                                                                                                           |
| void                                                                                              | [MD5Update](#a82247df9248c50d1c25809174a84dddd) ([MD5\_CTX](#structsdi_1_1_m_d5___c_t_x) \*context, const unsigned char \*input, unsigned int inputLen)                                                                                                                     |
| void                                                                                              | [MD5Final](#a9e31b7c8187ca0946de03fde1d9a8e88) (unsigned char digest\[16], [MD5\_CTX](#structsdi_1_1_m_d5___c_t_x) \*context)                                                                                                                                               |
| Language                                                                                          | [languageSupported](#a4353239935bf1239c84dfa9020272ad3) (unsigned val)                                                                                                                                                                                                      |
| const char \*                                                                                     | [getLanguageIsoCode](#a97211a5500a8f9b7e877624f5330460f) (Language lang\_id)                                                                                                                                                                                                |
| unsigned                                                                                          | [getLanguage](#a41554c6333a616786bb285dc51ab8ba9) (const char \*ISO\_639)                                                                                                                                                                                                   |
| const std::string                                                                                 | [getInternalTextKey](#acbe03b26f4cc788074b40c5f8245bc21) (unsigned EmvTextId)                                                                                                                                                                                               |
| [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) | [operator+](#afc5ba7603df562e3057600548a77ae19) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b)  |
| [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) | [operator-](#adf8b527bef1f0f4e433ad88ccae5677c) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b)  |
| bool                                                                                              | [operator==](#afde4ee00bda9f6a2e47be84d747b0aa6) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b) |
| bool                                                                                              | [operator!=](#a72b696981a0d47c3988c5d8a3b21771d) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b) |
| bool                                                                                              | [operator<](#a1826855f2717a1989f0acc9667add7f2) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b)  |
| bool                                                                                              | [operator<=](#ade8cda000c21abf3bba19952338f1ccc) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b) |
| bool                                                                                              | [operator>](#adbca0ff6b3aab2718e627c9d0936792d) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b)  |
| bool                                                                                              | [operator>=](#a1596310f42ff001cd38ed5cdc9c574ff) (const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&a, const [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&b) |
| [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) | [operator\*](#aa4cf2ca6912803ebf18f6a1ef14d6750) (int t, [TimeStamp::Unit\_MS](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md#classsdi_1_1_time_stamp_1_1_unit___m_s))                                                                |
| [TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) | [operator\*](#af58670d8fac6034c267d0445a833cd21) (int t, [TimeStamp::Unit\_S](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md#classsdi_1_1_time_stamp_1_1_unit___s))                                                                   |

***

### DataStructure Documentation <a href="#data-structure-documentation" id="data-structure-documentation"></a>

### sdi::MD5\_CTX <a href="#structsdi_1_1_m_d5___c_t_x" id="structsdi_1_1_m_d5___c_t_x"></a>

struct sdi::MD5\_CTX

MD5 context.

|               |             |                                         |
| ------------- | ----------- | --------------------------------------- |
| Data Fields   |             |                                         |
| unsigned char | buffer\[64] | input buffer                            |
| uint32\_t     | count\[2]   | number of bits, modulo 2^64 (lsb first) |
| uint32\_t     | state\[4]   | state (ABCD)                            |

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### bintohex() <a href="#adb43cc15cc5e467d2a32db177abd95ac" id="adb43cc15cc5e467d2a32db177abd95ac"></a>

void bintohex

convert a binary buffer to ASCII-HEX representation (0-9,A-F) Please note: A string termination is not appended.

**Parameters**

\[out] **dst** destination buffer of size 2\*srclen \[in] **src** source buffer \[in] **srclen** length of source data

{% hint style="info" %}
src and dest may be identical
{% endhint %}

#### Author

M. Meixner

#### Date

9.9.2005

### bintohexstring()\[1/5] <a href="#a451fd8059d3954678d5ad223175cb078" id="a451fd8059d3954678d5ad223175cb078"></a>

void bintohexstring

same as [bintohex()](#adb43cc15cc5e467d2a32db177abd95ac), but adds zero terminator to end of `dst`

**Parameters**

\[out] **dst** destination buffer of size 2\*srclen+1 \[in] **src** source buffer \[in] **srclen** length of source data

{% hint style="info" %}
src and dest may be identical
{% endhint %}

### bintohexstring()\[2/5] <a href="#a36bdbba7b034d5eca9058f51ae40bfd1" id="a36bdbba7b034d5eca9058f51ae40bfd1"></a>

void sdi::bintohexstring

same as [bintohex()](#adb43cc15cc5e467d2a32db177abd95ac), but converts the hexdump into a csd\_string

**Parameters**

\[out] **dst** destination csd\_string returned with size 2\*srclen \[in] **src** source buffer \[in] **srclen** length of source data

### bintohexstring()\[3/5] <a href="#a6afe79e222ca1a9079f715b758dc4255" id="a6afe79e222ca1a9079f715b758dc4255"></a>

void sdi::bintohexstring

### bintohexstring()\[4/5] <a href="#a5e63c92e42e60c105bf33ec9734ccc6f" id="a5e63c92e42e60c105bf33ec9734ccc6f"></a>

void sdi::bintohexstring

same as [bintohex()](#adb43cc15cc5e467d2a32db177abd95ac), but converts hexdump into a STL string

**Parameters**

\[out] **dst** destination string returned with size 2\*srclen \[in] **src** source buffer \[in] **srclen** length of source data

### bintohexstring()\[5/5] <a href="#a13312c8bd33a98c730b4c757e55a5304" id="a13312c8bd33a98c730b4c757e55a5304"></a>

void sdi::bintohexstring

### bintotrack2() <a href="#a8da4aa04db98292e03fb0c769642ac4e" id="a8da4aa04db98292e03fb0c769642ac4e"></a>

void bintotrack2

convert a binary buffer to ASCII-HEX track2 representation ('0'-'?') Please note: A string termination is not appended.

**Parameters**

\[out] **dst** destination buffer of size 2\*srclen \[in] **src** source buffer \[in] **srclen** length of source data

{% hint style="info" %}
src and dest may be identical
{% endhint %}

### bintotrack2string()\[1/2] <a href="#a8836d3db59a0107a55d45c6726967973" id="a8836d3db59a0107a55d45c6726967973"></a>

void sdi::bintotrack2string

same as [bintotrack2()](#a8da4aa04db98292e03fb0c769642ac4e), but converts the binary track 2 into a csd\_string

**Parameters**

\[out] **dst** destination csd\_string returned with size 2\*srclen \[in] **src** source buffer \[in] **srclen** length of source data

### bintotrack2string()\[2/2] <a href="#a86d21f7d6c1590dfd83b11e0228e6dc4" id="a86d21f7d6c1590dfd83b11e0228e6dc4"></a>

void sdi::bintotrack2string

### getInternalTextKey() <a href="#acbe03b26f4cc788074b40c5f8245bc21" id="acbe03b26f4cc788074b40c5f8245bc21"></a>

const std::string getInternalTextKey

Get the requested catalog text key corresponding to the EMV text ID.

{% hint style="info" %}
A text for an EMV text ID can be composed additional multiple text keys of the catalog. For more details read describtion of [UICatalog::getText()](/adk-5.0-programmers-guide/readme/annotated/class_u_i_catalog.md#a9bf11d9db05366a4dc04f6c53a16c2e6), which is used to lookup texts from the catalogs.
{% endhint %}

\*\*Parameters\*\*

\[in] **EmvTextId** ID of the EMV Text

#### Returns

catalog text key or empty string TXT\_NO\_TXT (if SDI doesn't provide one for this EMV text ID)

### getLanguage() <a href="#a41554c6333a616786bb285dc51ab8ba9" id="a41554c6333a616786bb285dc51ab8ba9"></a>

unsigned getLanguage

Get the language corresponding to the ISO 639-1 value

**Parameters**

\[in] **ISO\_639** ISO 639-1 value (e.g. de, en, fr) The buffer must be at least 2 bytes!

#### Returns

EMV language ID (use languageValid() afterwards, to check if supported by SDI) For an invalid or unknown ISO string, 0 is returned.

### getLanguageIsoCode() <a href="#a97211a5500a8f9b7e877624f5330460f" id="a97211a5500a8f9b7e877624f5330460f"></a>

const char \\\* getLanguageIsoCode

Get the ISO 639 value corresponding to the language ID

**Parameters**

\[in] **lang\_id** language ID of enum Language (see lang.h)

#### Returns

ISO 639-1 value C-string (two bytes, zero terminated). For LANG\_NO\_LANG an empty string is returned.

### hextobin()\[1/2] <a href="#a62d4f9a462bed89ebf473e377b7a24ad" id="a62d4f9a462bed89ebf473e377b7a24ad"></a>

int hextobin

same as [hextobin()](#aa7fda2cc5788cacfc2e267534b6391cd), but converts the result into a csd\_data buffer

**Parameters**

\[out] **dst** destination csd\_data buffer with returned size srclen/2 \[in] **src** source buffer \[in] **srclen** length of source data, must be even!

{% hint style="info" %}
src and internal buffer of dst may be identical
{% endhint %}

#### Returns

1 if successful, 0 if the input contained invalid characters

### hextobin()\[2/2] <a href="#aa7fda2cc5788cacfc2e267534b6391cd" id="aa7fda2cc5788cacfc2e267534b6391cd"></a>

int hextobin

convert an ASCII-HEX buffer to binary

**Parameters**

\[out] **dst** destination buffer of size srclen/2 \[in] **src** source buffer \[in] **srclen** length of source data, must be even!

#### Returns

1 if successful, 0 if the input contained invalid characters or parameter error

{% hint style="info" %}
src and dest may be identical
{% endhint %}

#### Author

M. Meixner

#### Date

9.9.2005

### languageSupported() <a href="#a4353239935bf1239c84dfa9020272ad3" id="a4353239935bf1239c84dfa9020272ad3"></a>

Language languageSupported

check value *val*, if it represents a valid/supported language ID.

**Parameters**

\[in] **val** potential valid language ID

#### Returns

LANG\_NO\_LANG if value *val* is not valid/supported, else another ID of enum Language (see lang.h)

### MD5Final() <a href="#a9e31b7c8187ca0946de03fde1d9a8e88" id="a9e31b7c8187ca0946de03fde1d9a8e88"></a>

void MD5Final

MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context.

**Parameters**

\[out] **digest** the generated digest \[in] **context** MD5 context

### MD5Init() <a href="#a08e47999152d737f33fda2b8729c4f7c" id="a08e47999152d737f33fda2b8729c4f7c"></a>

void MD5Init

MD5 initialization. Begins an MD5 operation, writing a new context.

**Parameters**

\[out] **context** MD5 context

### MD5Update() <a href="#a82247df9248c50d1c25809174a84dddd" id="a82247df9248c50d1c25809174a84dddd"></a>

void MD5Update

MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context.

**Parameters**

\[in,out] **context** MD5 context \[in] **input** input data \[in] **inputLen** number of bytes in input

### operator!=() <a href="#a72b696981a0d47c3988c5d8a3b21771d" id="a72b696981a0d47c3988c5d8a3b21771d"></a>

bool sdi::operator!=

inline

compare two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a!=b

### operator\*()\[1/2] <a href="#aa4cf2ca6912803ebf18f6a1ef14d6750" id="aa4cf2ca6912803ebf18f6a1ef14d6750"></a>

[TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) sdi::operator\\\*

inline

convert int to time value by multiplying with MS unit

**Parameters**

\[in] **t** time in milliseconds

#### Returns

time value

### operator\*()\[2/2] <a href="#af58670d8fac6034c267d0445a833cd21" id="af58670d8fac6034c267d0445a833cd21"></a>

[TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) sdi::operator\\\*

inline

convert int to time value by multiplying with S unit

**Parameters**

\[in] **t** time in seconds

#### Returns

time value

### operator+() <a href="#afc5ba7603df562e3057600548a77ae19" id="afc5ba7603df562e3057600548a77ae19"></a>

[TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) operator+

add two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a+b

### operator-() <a href="#adf8b527bef1f0f4e433ad88ccae5677c" id="adf8b527bef1f0f4e433ad88ccae5677c"></a>

[TimeStamp](/adk-5.0-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) operator-

substract two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a-b

### operator<() <a href="#a1826855f2717a1989f0acc9667add7f2" id="a1826855f2717a1989f0acc9667add7f2"></a>

bool sdi::operator\\<

inline

compare two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a\<b

### operator<=() <a href="#ade8cda000c21abf3bba19952338f1ccc" id="ade8cda000c21abf3bba19952338f1ccc"></a>

bool sdi::operator\\<=

inline

compare two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a<=b

### operator==() <a href="#afde4ee00bda9f6a2e47be84d747b0aa6" id="afde4ee00bda9f6a2e47be84d747b0aa6"></a>

bool sdi::operator==

inline

compare two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a==b

### operator>() <a href="#adbca0ff6b3aab2718e627c9d0936792d" id="adbca0ff6b3aab2718e627c9d0936792d"></a>

bool sdi::operator\\>

inline

compare two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a>b

### operator>=() <a href="#a1596310f42ff001cd38ed5cdc9c574ff" id="a1596310f42ff001cd38ed5cdc9c574ff"></a>

bool sdi::operator\\>=

inline

compare two time values

**Parameters**

\[in] **a** first time value \[in] **b** second time value

#### Returns

result of a>=b

### track2tobin()\[1/2] <a href="#ae42d999b07e327fe3aea4bfe156cef0a" id="ae42d999b07e327fe3aea4bfe156cef0a"></a>

int track2tobin

same as [track2tobin()](#ad7b26a90792d2c2e5486941ed7b4dd7c), but converts the result into a csd\_data buffer

**Parameters**

\[out] **dst** destination csd\_data buffer with returned size srclen/2 \[in] **src** source buffer \[in] **srclen** length of source data, must be even!

#### Returns

1 if successful, 0 if the input contained invalid characters

### track2tobin()\[2/2] <a href="#ad7b26a90792d2c2e5486941ed7b4dd7c" id="ad7b26a90792d2c2e5486941ed7b4dd7c"></a>

int track2tobin

convert an track 2 HEX buffer ('0'-'?') to binary

**Parameters**

\[out] **dst** destination buffer of size srclen/2 \[in] **src** source buffer \[in] **srclen** length of source data, must be even!

#### Returns

1 if successful, 0 if the input contained invalid characters

{% hint style="info" %}
src and dest may be identical
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/adk-5.0-programmers-guide/readme/namespaces/namespacesdi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
