mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-31 14:08:20 +08:00
mdbx-tools: преобразование из hex без переходов в mdbx_load
.
This commit is contained in:
parent
12eb2df57d
commit
2f66eb9fec
@ -369,16 +369,15 @@ static int badend(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int unhex(unsigned char *c2) {
|
static inline int unhex(unsigned char *c2) {
|
||||||
int x, c;
|
int8_t hi = c2[0];
|
||||||
x = *c2++ & 0x4f;
|
hi = (hi | 0x20) - 'a';
|
||||||
if (x & 0x40)
|
hi += 10 + ((hi >> 7) & 39);
|
||||||
x -= 55;
|
|
||||||
c = x << 4;
|
int8_t lo = c2[1];
|
||||||
x = *c2 & 0x4f;
|
lo = (lo | 0x20) - 'a';
|
||||||
if (x & 0x40)
|
lo += 10 + ((lo >> 7) & 39);
|
||||||
x -= 55;
|
|
||||||
c |= x;
|
return hi << 4 | lo;
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__hot static int readline(MDBX_val *out, MDBX_val *buf) {
|
__hot static int readline(MDBX_val *out, MDBX_val *buf) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user