returns -1 if this is not a hex string
| 259 | |
| 260 | ///returns -1 if this is not a hex string |
| 261 | int HexStringToBytesLength(const std::string& str) |
| 262 | { |
| 263 | if(str.size()>2 && str[0] == '0' && toupper(str[1]) == 'X') |
| 264 | return str.size()/2-1; |
| 265 | else return -1; |
| 266 | } |
| 267 | |
| 268 | int Base64StringToBytesLength(const std::string& str) |
| 269 | { |