-
Notifications
You must be signed in to change notification settings - Fork 17
/
conversion.h
executable file
·56 lines (45 loc) · 1.25 KB
/
conversion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef CONVERSION_H
#define CONVERSION_H
/*******************************************************************************
CONVERSION -- Big integers format conversion
*******************************************************************************/
#include <stdint.h>
// convert string of decimal digits to string of 64 hexadecimal digits
int DecStrToHexStrOf64(
const char * in,
const uint32_t inlen,
char * out
);
// convert string of hexadecimal digits to big endian
void HexStrToBigEndian(
const char * in,
const uint32_t inlen,
uint8_t * out,
const uint32_t outlen
);
// convert string of hexadecimal digits to little endian
void HexStrToLittleEndian(
const char * in,
const uint32_t inlen,
uint8_t * out,
const uint32_t outlen
);
// convert little endian of 256 bits to string of decimal digits
void LittleEndianOf256ToDecStr(
const uint8_t * in,
char * out,
uint32_t * outlen
);
// convert little endian to string of hexadecimal digits
void LittleEndianToHexStr(
const uint8_t * in,
const uint32_t inlen,
char * out
);
// convert big endian to string of hexadecimal digits
void BigEndianToHexStr(
const uint8_t * in,
const uint32_t inlen,
char * out
);
#endif // CONVERSION_H