| 317 | } |
| 318 | |
| 319 | static bool ia_hash(const char *s) { |
| 320 | size_t len = strlen(s); |
| 321 | if (len != 40 && len != 64) |
| 322 | return false; |
| 323 | for (size_t i = 0; i < len; i++) |
| 324 | if (!((s[i] >= '0' && s[i] <= '9') || (s[i] >= 'a' && s[i] <= 'f'))) |
| 325 | return false; |
| 326 | return true; |
| 327 | } |
| 328 | |
| 329 | static char *ia_token(char **cursor, const char *end) { |
| 330 | if (*cursor >= end) |