26 const int Uuid::bytes_per_section[Uuid::NUMBER_OF_SECTIONS]=
28 const int Uuid::hex_to_byte[]=
30 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
31 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
32 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
33 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
34 -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
35 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
36 -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
37 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
38 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
39 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
40 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
41 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
42 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
43 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
44 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
45 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
51 DBUG_ENTER(
"Uuid::parse");
52 unsigned char *u=
bytes;
53 unsigned char *ss= (
unsigned char *)s;
54 for (
int i= 0;
i < NUMBER_OF_SECTIONS;
i++)
59 RETURN_UNREPORTED_ERROR;
62 for (
int j= 0; j < bytes_per_section[
i]; j++)
64 int hi= hex_to_byte[*ss];
66 RETURN_UNREPORTED_ERROR;
68 int lo= hex_to_byte[*ss];
70 RETURN_UNREPORTED_ERROR;
82 DBUG_ENTER(
"Uuid::is_valid");
83 const unsigned char *ss= (
const unsigned char *)s;
84 for (
int i= 0;
i < NUMBER_OF_SECTIONS;
i++)
92 for (
int j= 0; j < bytes_per_section[
i]; j++)
94 if (hex_to_byte[*ss] == -1)
97 if (hex_to_byte[*ss] == -1)
108 DBUG_ENTER(
"Uuid::to_string");
109 static const char byte_to_hex[]=
"0123456789abcdef";
110 const unsigned char *u= bytes_arg;
111 for (
int i= 0;
i < NUMBER_OF_SECTIONS;
i++)
118 for (
int j= 0; j < bytes_per_section[
i]; j++)
121 *buf= byte_to_hex[byte >> 4];
123 *buf= byte_to_hex[byte & 0xf];