MCPcopy Create free account
hub / github.com/NetHack/NetHack / xcrypt

Function xcrypt

src/hacklib.c:399–415  ·  view source on GitHub ↗

trivial text encryption routine (see makedefs) */

Source from the content-addressed store, hash-verified

397
398/* trivial text encryption routine (see makedefs) */
399char *
400xcrypt(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? */
418boolean

Callers 9

doengrave_sfx_item_WANFunction · 0.85
rumor_checkFunction · 0.85
others_checkFunction · 0.85
get_rnd_lineFunction · 0.85
outoracleFunction · 0.85
init_CapMonsFunction · 0.85
read_rumors_fileFunction · 0.85
do_rnd_access_fileFunction · 0.85
do_oraclesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected