Remove the separator and padding characters from the code.
| 106 | |
| 107 | // Remove the separator and padding characters from the code. |
| 108 | std::string clean_code_chars(const std::string &code) { |
| 109 | std::string clean_code(code); |
| 110 | clean_code.erase( |
| 111 | std::remove(clean_code.begin(), clean_code.end(), internal::kSeparator), |
| 112 | clean_code.end()); |
| 113 | if (clean_code.find(internal::kPaddingCharacter)) { |
| 114 | clean_code = |
| 115 | clean_code.substr(0, clean_code.find(internal::kPaddingCharacter)); |
| 116 | } |
| 117 | return clean_code; |
| 118 | } |
| 119 | |
| 120 | } // anonymous namespace |
| 121 |