mirror of
https://github.com/GOSTSec/vanitygen
synced 2025-02-07 12:24:20 +00:00
Minor tweak to prefix case-enumerator
This commit is contained in:
parent
af42e55a22
commit
9c6fae2965
11
pattern.c
11
pattern.c
@ -1145,9 +1145,9 @@ static const unsigned char b58_case_map[256] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 1, 1, 1, 1, 1, 1, 1, 1, 105, 1, 1, 0, 1, 1, 111,
|
||||
0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 1, 2,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 76, 1, 1, 0,
|
||||
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
@ -1162,13 +1162,16 @@ prefix_case_iter_init(prefix_case_iter_t *cip, const char *pfx)
|
||||
if (i > sizeof(cip->ci_prefix))
|
||||
return 0;
|
||||
if (!b58_case_map[(int)pfx[i]]) {
|
||||
/* Character isn't case-swappable, ignore it */
|
||||
cip->ci_prefix[i] = pfx[i];
|
||||
continue;
|
||||
}
|
||||
if (b58_case_map[(int)pfx[i]] > 1) {
|
||||
cip->ci_prefix[i] = b58_case_map[(int)pfx[i]];
|
||||
if (b58_case_map[(int)pfx[i]] == 2) {
|
||||
/* Character invalid, but valid in swapped case */
|
||||
cip->ci_prefix[i] = pfx[i] ^ 0x20;
|
||||
continue;
|
||||
}
|
||||
/* Character is case-swappable */
|
||||
cip->ci_prefix[i] = pfx[i] | 0x20;
|
||||
cip->ci_case_map[(int)cip->ci_nbits] = i;
|
||||
cip->ci_nbits++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user