ID Chip Reader
util.h
Go to the documentation of this file.
1 
7 #pragma once
8 #ifndef UTILS_UTIL_H_
9 #define UTILS_UTIL_H_
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
19 void Delay(int millisecond);
20 
26 void RandomNonceGenerate(unsigned char* buffer, int len);
27 
33 void PadByteArray(unsigned char* byteArray, int startPosition);
34 
40 int CharToInt(const char c);
41 
47 char IntToChar(const int i);
48 
55 int CheckDigitCalculate(const unsigned char* data, int length);
56 
63 int ExpirationYearCalculate(const int birthYear, const int currentYear);
64 
71 int CharToYear(const unsigned char year[2], const int currentYear);
72 
79 int IsValidDate(int day, int month);
80 
88 void MrzInformationGenerate(const unsigned char documentNumber[9],
89  const unsigned char birthDate[4],
90  unsigned char mrzInformation[24],
91  int currentYear);
92 
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif // #ifndef UTILS_UTIL_H_