| 544 | // ---------------------------------------------------------------------------- |
| 545 | |
| 546 | void VanitySearch::enumCaseUnsentivePrefix(std::string s, std::vector<std::string> &list) { |
| 547 | |
| 548 | char letter[64]; |
| 549 | int letterpos[64]; |
| 550 | int nbLetter = 0; |
| 551 | int length = (int)s.length(); |
| 552 | |
| 553 | for (int i = 1; i < length; i++) { |
| 554 | char c = s.data()[i]; |
| 555 | if( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ) { |
| 556 | letter[nbLetter] = tolower(c); |
| 557 | letterpos[nbLetter] = i; |
| 558 | nbLetter++; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | int total = 1 << nbLetter; |
| 563 | |
| 564 | for (int i = 0; i < total; i++) { |
| 565 | |
| 566 | char tmp[64]; |
| 567 | strcpy(tmp, s.c_str()); |
| 568 | |
| 569 | for (int j = 0; j < nbLetter; j++) { |
| 570 | int mask = 1 << j; |
| 571 | if (mask&i) tmp[letterpos[j]] = toupper(letter[j]); |
| 572 | else tmp[letterpos[j]] = letter[j]; |
| 573 | } |
| 574 | |
| 575 | list.push_back(string(tmp)); |
| 576 | |
| 577 | } |
| 578 | |
| 579 | } |
| 580 | |
| 581 | // ---------------------------------------------------------------------------- |
| 582 |
nothing calls this directly
no outgoing calls
no test coverage detected