trivial text encryption routine (see makedefs) */
| 397 | |
| 398 | /* trivial text encryption routine (see makedefs) */ |
| 399 | char * |
| 400 | xcrypt(const char *str, char *buf) |
| 401 | { |
| 402 | const char *p; |
| 403 | char *q; |
| 404 | int bitmask; |
| 405 | |
| 406 | for (bitmask = 1, p = str, q = buf; *p; q++) { |
| 407 | *q = *p++; |
| 408 | if (*q & (32 | 64)) |
| 409 | *q ^= bitmask; |
| 410 | if ((bitmask <<= 1) >= 32) |
| 411 | bitmask = 1; |
| 412 | } |
| 413 | *q = '\0'; |
| 414 | return buf; |
| 415 | } |
| 416 | |
| 417 | /* is a string entirely whitespace? */ |
| 418 | boolean |
no outgoing calls
no test coverage detected