home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / lib / tests / base64t.c next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  127.2 KB  |  3,029 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "plbase64.h"
  20. #include "plstr.h"
  21. #include "nspr.h"
  22.  
  23. #include <stdio.h>
  24.  
  25. static unsigned char *base = (unsigned char *)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  26.  
  27. /* PL_Base64Encode, single characters */
  28. PRBool test_001(void)
  29. {
  30.     PRUint32 a, b;
  31.     unsigned char plain[ 4 ];
  32.     unsigned char cypher[ 5 ];
  33.     char result[ 8 ];
  34.     char *rv;
  35.  
  36.     printf("Test 001 (PL_Base64Encode, single characters)                         ..."); fflush(stdout);
  37.  
  38.     plain[1] = plain[2] = plain[3] = (unsigned char)0;
  39.     cypher[2] = cypher[3] = (unsigned char)'=';
  40.     cypher[4] = (unsigned char)0;
  41.  
  42.     for( a = 0; a < 64; a++ )
  43.     {
  44.         cypher[0] = base[a];
  45.  
  46.         for( b = 0; b < 4; b++ )
  47.         {
  48.             plain[0] = (unsigned char)(a * 4 + b);
  49.             cypher[1] = base[(b * 16)];
  50.  
  51.             rv = PL_Base64Encode((char *)plain, 1, result);
  52.             if( rv != result )
  53.             {
  54.                 printf("FAIL\n\t(%d, %d): return value\n", a, b);
  55.                 return PR_FALSE;
  56.             }
  57.  
  58.             if( 0 != PL_strncmp((char *)cypher, result, 4) )
  59.             {
  60.                 printf("FAIL\n\t(%d, %d): expected \"%s,\" got \"%.4s.\"\n",
  61.                        a, b, cypher, result);
  62.                 return PR_FALSE;
  63.             }
  64.         }
  65.     }
  66.  
  67.     printf("PASS\n");
  68.     return PR_TRUE;
  69. }
  70.  
  71. /* PL_Base64Encode, double characters */
  72. PRBool test_002(void)
  73. {
  74.     PRUint32 a, b, c, d;
  75.     unsigned char plain[ 4 ];
  76.     unsigned char cypher[ 5 ];
  77.     char result[ 8 ];
  78.     char *rv;
  79.  
  80.     printf("Test 002 (PL_Base64Encode, double characters)                         ..."); fflush(stdout);
  81.  
  82.     plain[2] = plain[3] = (unsigned char)0;
  83.     cypher[3] = (unsigned char)'=';
  84.     cypher[4] = (unsigned char)0;
  85.  
  86.     for( a = 0; a < 64; a++ )
  87.     {
  88.         cypher[0] = base[a];
  89.         for( b = 0; b < 4; b++ )
  90.         {
  91.             plain[0] = (a*4) + b;
  92.             for( c = 0; c < 16; c++ )
  93.             {
  94.                 cypher[1] = base[b*16 + c];
  95.                 for( d = 0; d < 16; d++ )
  96.                 {
  97.                     plain[1] = c*16 + d;
  98.                     cypher[2] = base[d*4];
  99.  
  100.                     rv = PL_Base64Encode((char *)plain, 2, result);
  101.                     if( rv != result )
  102.                     {
  103.                         printf("FAIL\n\t(%d, %d, %d, %d): return value\n", a, b, c, d);
  104.                         return PR_FALSE;
  105.                     }
  106.  
  107.                     if( 0 != PL_strncmp((char *)cypher, result, 4) )
  108.                     {
  109.                         printf("FAIL\n\t(%d, %d, %d, %d): expected \"%s,\" got \"%.4s.\"\n",
  110.                                a, b, c, d, cypher, result);
  111.                         return PR_FALSE;
  112.                     }
  113.                 }
  114.             }
  115.         }
  116.     }
  117.  
  118.     printf("PASS\n");
  119.     return PR_TRUE;
  120. }
  121.  
  122. /* PL_Base64Encode, triple characters */
  123. PRBool test_003(void)
  124. {
  125.     PRUint32 a, b, c, d, e, f;
  126.     unsigned char plain[ 4 ];
  127.     unsigned char cypher[ 5 ];
  128.     char result[ 8 ];
  129.     char *rv;
  130.  
  131.     printf("Test 003 (PL_Base64Encode, triple characters)                         ..."); fflush(stdout);
  132.  
  133.     cypher[4] = (unsigned char)0;
  134.  
  135.     for( a = 0; a < 64; a++ )
  136.     {
  137.         cypher[0] = base[a];
  138.         for( b = 0; b < 4; b++ )
  139.         {
  140.             plain[0] = (a*4) + b;
  141.             for( c = 0; c < 16; c++ )
  142.             {
  143.                 cypher[1] = base[b*16 + c];
  144.                 for( d = 0; d < 16; d++ )
  145.                 {
  146.                     plain[1] = c*16 + d;
  147.                     for( e = 0; e < 4; e++ )
  148.                     {
  149.                         cypher[2] = base[d*4 + e];
  150.                         for( f = 0; f < 64; f++ )
  151.                         {
  152.                             plain[2] = e * 64 + f;
  153.                             cypher[3] = base[f];
  154.  
  155.                             rv = PL_Base64Encode((char *)plain, 3, result);
  156.                             if( rv != result )
  157.                             {
  158.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): return value\n", a, b, c, d, e, f);
  159.                                 return PR_FALSE;
  160.                             }
  161.  
  162.                             if( 0 != PL_strncmp((char *)cypher, result, 4) )
  163.                             {
  164.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): expected \"%s,\" got \"%.4s.\"\n",
  165.                                        a, b, c, d, e, f, cypher, result);
  166.                                 return PR_FALSE;
  167.                             }
  168.                         }
  169.                     }
  170.                 }
  171.             }
  172.         }
  173.     }
  174.  
  175.     printf("PASS\n");
  176.     return PR_TRUE;
  177. }
  178.  
  179.     static struct
  180.     {
  181.         const char *plaintext;
  182.         const char *cyphertext;
  183.     } array[] =
  184.       {
  185.           /* Cyphertexts generated with uuenview 0.5.13 */
  186.           { " ", "IA==" },
  187.           { ".", "Lg==" },
  188.           { "/", "Lw==" },
  189.           { "C", "Qw==" },
  190.           { "H", "SA==" },
  191.           { "S", "Uw==" },
  192.           { "^", "Xg==" },
  193.           { "a", "YQ==" },
  194.           { "o", "bw==" },
  195.           { "t", "dA==" },
  196.  
  197.           { "AB", "QUI=" },
  198.           { "AH", "QUg=" },
  199.           { "AQ", "QVE=" },
  200.           { "BD", "QkQ=" },
  201.           { "CR", "Q1I=" },
  202.           { "CS", "Q1M=" },
  203.           { "DB", "REI=" },
  204.           { "DC", "REM=" },
  205.           { "EK", "RUs=" },
  206.           { "ET", "RVQ=" },
  207.           { "IM", "SU0=" },
  208.           { "JR", "SlI=" },
  209.           { "LO", "TE8=" },
  210.           { "LW", "TFc=" },
  211.           { "ML", "TUw=" },
  212.           { "SB", "U0I=" },
  213.           { "TO", "VE8=" },
  214.           { "VS", "VlM=" },
  215.           { "WP", "V1A=" },
  216.           /* legitimate two-letter words */
  217.           { "ad", "YWQ=" },
  218.           { "ah", "YWg=" },
  219.           { "am", "YW0=" },
  220.           { "an", "YW4=" },
  221.           { "as", "YXM=" },
  222.           { "at", "YXQ=" },
  223.           { "ax", "YXg=" },
  224.           { "be", "YmU=" },
  225.           { "by", "Ynk=" },
  226.           { "do", "ZG8=" },
  227.           { "go", "Z28=" },
  228.           { "he", "aGU=" },
  229.           { "hi", "aGk=" },
  230.           { "if", "aWY=" },
  231.           { "in", "aW4=" },
  232.           { "is", "aXM=" },
  233.           { "it", "aXQ=" },
  234.           { "me", "bWU=" },
  235.           { "my", "bXk=" },
  236.           { "no", "bm8=" },
  237.           { "of", "b2Y=" },
  238.           { "on", "b24=" },
  239.           { "or", "b3I=" },
  240.           { "ox", "b3g=" },
  241.           { "so", "c28=" },
  242.           { "to", "dG8=" },
  243.           { "up", "dXA=" },
  244.           { "us", "dXM=" },
  245.           { "we", "d2U=" },
  246.           /* all three-letter entries in /usr/dict/words */
  247.           { "1st", "MXN0" },
  248.           { "2nd", "Mm5k" },
  249.           { "3rd", "M3Jk" },
  250.           { "4th", "NHRo" },
  251.           { "5th", "NXRo" },
  252.           { "6th", "NnRo" },
  253.           { "7th", "N3Ro" },
  254.           { "8th", "OHRo" },
  255.           { "9th", "OXRo" },
  256.           { "AAA", "QUFB" },
  257.           { "AAU", "QUFV" },
  258.           { "ABA", "QUJB" },
  259.           { "abc", "YWJj" },
  260.           { "Abe", "QWJl" },
  261.           { "Abo", "QWJv" },
  262.           { "ace", "YWNl" },
  263.           { "ACM", "QUNN" },
  264.           { "ACS", "QUNT" },
  265.           { "act", "YWN0" },
  266.           { "Ada", "QWRh" },
  267.           { "add", "YWRk" },
  268.           { "ado", "YWRv" },
  269.           { "aft", "YWZ0" },
  270.           { "age", "YWdl" },
  271.           { "ago", "YWdv" },
  272.           { "aid", "YWlk" },
  273.           { "ail", "YWls" },
  274.           { "aim", "YWlt" },
  275.           { "air", "YWly" },
  276.           { "ala", "YWxh" },
  277.           { "alb", "YWxi" },
  278.           { "ale", "YWxl" },
  279.           { "Ali", "QWxp" },
  280.           { "all", "YWxs" },
  281.           { "alp", "YWxw" },
  282.           { "A&M", "QSZN" },
  283.           { "AMA", "QU1B" },
  284.           { "ami", "YW1p" },
  285.           { "amp", "YW1w" },
  286.           { "Amy", "QW15" },
  287.           { "amy", "YW15" },
  288.           { "ana", "YW5h" },
  289.           { "and", "YW5k" },
  290.           { "ani", "YW5p" },
  291.           { "Ann", "QW5u" },
  292.           { "ant", "YW50" },
  293.           { "any", "YW55" },
  294.           { "A&P", "QSZQ" },
  295.           { "ape", "YXBl" },
  296.           { "Apr", "QXBy" },
  297.           { "APS", "QVBT" },
  298.           { "apt", "YXB0" },
  299.           { "arc", "YXJj" },
  300.           { "are", "YXJl" },
  301.           { "ark", "YXJr" },
  302.           { "arm", "YXJt" },
  303.           { "art", "YXJ0" },
  304.           { "a's", "YSdz" },
  305.           { "ash", "YXNo" },
  306.           { "ask", "YXNr" },
  307.           { "ass", "YXNz" },
  308.           { "ate", "YXRl" },
  309.           { "Aug", "QXVn" },
  310.           { "auk", "YXVr" },
  311.           { "Ave", "QXZl" },
  312.           { "awe", "YXdl" },
  313.           { "awl", "YXds" },
  314.           { "awn", "YXdu" },
  315.           { "axe", "YXhl" },
  316.           { "aye", "YXll" },
  317.           { "bad", "YmFk" },
  318.           { "bag", "YmFn" },
  319.           { "bah", "YmFo" },
  320.           { "bam", "YmFt" },
  321.           { "ban", "YmFu" },
  322.           { "bar", "YmFy" },
  323.           { "bat", "YmF0" },
  324.           { "bay", "YmF5" },
  325.           { "bed", "YmVk" },
  326.           { "bee", "YmVl" },
  327.           { "beg", "YmVn" },
  328.           { "bel", "YmVs" },
  329.           { "Ben", "QmVu" },
  330.           { "bet", "YmV0" },
  331.           { "bey", "YmV5" },
  332.           { "bib", "Ymli" },
  333.           { "bid", "Ymlk" },
  334.           { "big", "Ymln" },
  335.           { "bin", "Ymlu" },
  336.           { "bit", "Yml0" },
  337.           { "biz", "Yml6" },
  338.           { "BMW", "Qk1X" },
  339.           { "boa", "Ym9h" },
  340.           { "bob", "Ym9i" },
  341.           { "bog", "Ym9n" },
  342.           { "bon", "Ym9u" },
  343.           { "boo", "Ym9v" },
  344.           { "bop", "Ym9w" },
  345.           { "bow", "Ym93" },
  346.           { "box", "Ym94" },
  347.           { "boy", "Ym95" },
  348.           { "b's", "Yidz" },
  349.           { "BTL", "QlRM" },
  350.           { "BTU", "QlRV" },
  351.           { "bub", "YnVi" },
  352.           { "bud", "YnVk" },
  353.           { "bug", "YnVn" },
  354.           { "bum", "YnVt" },
  355.           { "bun", "YnVu" },
  356.           { "bus", "YnVz" },
  357.           { "but", "YnV0" },
  358.           { "buy", "YnV5" },
  359.           { "bye", "Ynll" },
  360.           { "cab", "Y2Fi" },
  361.           { "Cal", "Q2Fs" },
  362.           { "cam", "Y2Ft" },
  363.           { "can", "Y2Fu" },
  364.           { "cap", "Y2Fw" },
  365.           { "car", "Y2Fy" },
  366.           { "cat", "Y2F0" },
  367.           { "caw", "Y2F3" },
  368.           { "CBS", "Q0JT" },
  369.           { "CDC", "Q0RD" },
  370.           { "CEQ", "Q0VR" },
  371.           { "chi", "Y2hp" },
  372.           { "CIA", "Q0lB" },
  373.           { "cit", "Y2l0" },
  374.           { "cod", "Y29k" },
  375.           { "cog", "Y29n" },
  376.           { "col", "Y29s" },
  377.           { "con", "Y29u" },
  378.           { "coo", "Y29v" },
  379.           { "cop", "Y29w" },
  380.           { "cos", "Y29z" },
  381.           { "cot", "Y290" },
  382.           { "cow", "Y293" },
  383.           { "cox", "Y294" },
  384.           { "coy", "Y295" },
  385.           { "CPA", "Q1BB" },
  386.           { "cpu", "Y3B1" },
  387.           { "CRT", "Q1JU" },
  388.           { "cry", "Y3J5" },
  389.           { "c's", "Yydz" },
  390.           { "cub", "Y3Vi" },
  391.           { "cud", "Y3Vk" },
  392.           { "cue", "Y3Vl" },
  393.           { "cup", "Y3Vw" },
  394.           { "cur", "Y3Vy" },
  395.           { "cut", "Y3V0" },
  396.           { "dab", "ZGFi" },
  397.           { "dad", "ZGFk" },
  398.           { "dam", "ZGFt" },
  399.           { "Dan", "RGFu" },
  400.           { "Dar", "RGFy" },
  401.           { "day", "ZGF5" },
  402.           { "Dec", "RGVj" },
  403.           { "Dee", "RGVl" },
  404.           { "Del", "RGVs" },
  405.           { "den", "ZGVu" },
  406.           { "Des", "RGVz" },
  407.           { "dew", "ZGV3" },
  408.           { "dey", "ZGV5" },
  409.           { "did", "ZGlk" },
  410.           { "die", "ZGll" },
  411.           { "dig", "ZGln" },
  412.           { "dim", "ZGlt" },
  413.           { "din", "ZGlu" },
  414.           { "dip", "ZGlw" },
  415.           { "Dis", "RGlz" },
  416.           { "DNA", "RE5B" },
  417.           { "DOD", "RE9E" },
  418.           { "doe", "ZG9l" },
  419.           { "dog", "ZG9n" },
  420.           { "don", "ZG9u" },
  421.           { "dot", "ZG90" },
  422.           { "Dow", "RG93" },
  423.           { "dry", "ZHJ5" },
  424.           { "d's", "ZCdz" },
  425.           { "dub", "ZHVi" },
  426.           { "dud", "ZHVk" },
  427.           { "due", "ZHVl" },
  428.           { "dug", "ZHVn" },
  429.           { "dun", "ZHVu" },
  430.           { "dye", "ZHll" },
  431.           { "ear", "ZWFy" },
  432.           { "eat", "ZWF0" },
  433.           { "ebb", "ZWJi" },
  434.           { "EDT", "RURU" },
  435.           { "eel", "ZWVs" },
  436.           { "eft", "ZWZ0" },
  437.           { "e.g", "ZS5n" },
  438.           { "egg", "ZWdn" },
  439.           { "ego", "ZWdv" },
  440.           { "eke", "ZWtl" },
  441.           { "Eli", "RWxp" },
  442.           { "elk", "ZWxr" },
  443.           { "ell", "ZWxs" },
  444.           { "elm", "ZWxt" },
  445.           { "Ely", "RWx5" },
  446.           { "end", "ZW5k" },
  447.           { "Eng", "RW5n" },
  448.           { "EPA", "RVBB" },
  449.           { "era", "ZXJh" },
  450.           { "ere", "ZXJl" },
  451.           { "erg", "ZXJn" },
  452.           { "err", "ZXJy" },
  453.           { "e's", "ZSdz" },
  454.           { "EST", "RVNU" },
  455.           { "eta", "ZXRh" },
  456.           { "etc", "ZXRj" },
  457.           { "Eva", "RXZh" },
  458.           { "eve", "ZXZl" },
  459.           { "ewe", "ZXdl" },
  460.           { "eye", "ZXll" },
  461.           { "FAA", "RkFB" },
  462.           { "fad", "ZmFk" },
  463.           { "fag", "ZmFn" },
  464.           { "fan", "ZmFu" },
  465.           { "far", "ZmFy" },
  466.           { "fat", "ZmF0" },
  467.           { "fay", "ZmF5" },
  468.           { "FBI", "RkJJ" },
  469.           { "FCC", "RkND" },
  470.           { "FDA", "RkRB" },
  471.           { "Feb", "RmVi" },
  472.           { "fed", "ZmVk" },
  473.           { "fee", "ZmVl" },
  474.           { "few", "ZmV3" },
  475.           { "fib", "Zmli" },
  476.           { "fig", "Zmln" },
  477.           { "fin", "Zmlu" },
  478.           { "fir", "Zmly" },
  479.           { "fit", "Zml0" },
  480.           { "fix", "Zml4" },
  481.           { "Flo", "Rmxv" },
  482.           { "flu", "Zmx1" },
  483.           { "fly", "Zmx5" },
  484.           { "FMC", "Rk1D" },
  485.           { "fob", "Zm9i" },
  486.           { "foe", "Zm9l" },
  487.           { "fog", "Zm9n" },
  488.           { "fop", "Zm9w" },
  489.           { "for", "Zm9y" },
  490.           { "fox", "Zm94" },
  491.           { "FPC", "RlBD" },
  492.           { "fro", "ZnJv" },
  493.           { "fry", "ZnJ5" },
  494.           { "f's", "Zidz" },
  495.           { "FTC", "RlRD" },
  496.           { "fum", "ZnVt" },
  497.           { "fun", "ZnVu" },
  498.           { "fur", "ZnVy" },
  499.           { "gab", "Z2Fi" },
  500.           { "gad", "Z2Fk" },
  501.           { "gag", "Z2Fn" },
  502.           { "gal", "Z2Fs" },
  503.           { "gam", "Z2Ft" },
  504.           { "GAO", "R0FP" },
  505.           { "gap", "Z2Fw" },
  506.           { "gar", "Z2Fy" },
  507.           { "gas", "Z2Fz" },
  508.           { "gay", "Z2F5" },
  509.           { "gee", "Z2Vl" },
  510.           { "gel", "Z2Vs" },
  511.           { "gem", "Z2Vt" },
  512.           { "get", "Z2V0" },
  513.           { "gig", "Z2ln" },
  514.           { "Gil", "R2ls" },
  515.           { "gin", "Z2lu" },
  516.           { "GMT", "R01U" },
  517.           { "GNP", "R05Q" },
  518.           { "gnu", "Z251" },
  519.           { "Goa", "R29h" },
  520.           { "gob", "Z29i" },
  521.           { "god", "Z29k" },
  522.           { "gog", "Z29n" },
  523.           { "GOP", "R09Q" },
  524.           { "got", "Z290" },
  525.           { "GPO", "R1BP" },
  526.           { "g's", "Zydz" },
  527.           { "GSA", "R1NB" },
  528.           { "gum", "Z3Vt" },
  529.           { "gun", "Z3Vu" },
  530.           { "Gus", "R3Vz" },
  531.           { "gut", "Z3V0" },
  532.           { "guy", "Z3V5" },
  533.           { "gym", "Z3lt" },
  534.           { "gyp", "Z3lw" },
  535.           { "had", "aGFk" },
  536.           { "Hal", "SGFs" },
  537.           { "ham", "aGFt" },
  538.           { "Han", "SGFu" },
  539.           { "hap", "aGFw" },
  540.           { "hat", "aGF0" },
  541.           { "haw", "aGF3" },
  542.           { "hay", "aGF5" },
  543.           { "hem", "aGVt" },
  544.           { "hen", "aGVu" },
  545.           { "her", "aGVy" },
  546.           { "hew", "aGV3" },
  547.           { "hex", "aGV4" },
  548.           { "hey", "aGV5" },
  549.           { "hid", "aGlk" },
  550.           { "him", "aGlt" },
  551.           { "hip", "aGlw" },
  552.           { "his", "aGlz" },
  553.           { "hit", "aGl0" },
  554.           { "hob", "aG9i" },
  555.           { "hoc", "aG9j" },
  556.           { "hoe", "aG9l" },
  557.           { "hog", "aG9n" },
  558.           { "hoi", "aG9p" },
  559.           { "Hom", "SG9t" },
  560.           { "hop", "aG9w" },
  561.           { "hot", "aG90" },
  562.           { "how", "aG93" },
  563.           { "hoy", "aG95" },
  564.           { "h's", "aCdz" },
  565.           { "hub", "aHVi" },
  566.           { "hue", "aHVl" },
  567.           { "hug", "aHVn" },
  568.           { "huh", "aHVo" },
  569.           { "hum", "aHVt" },
  570.           { "Hun", "SHVu" },
  571.           { "hut", "aHV0" },
  572.           { "Ian", "SWFu" },
  573.           { "IBM", "SUJN" },
  574.           { "Ibn", "SWJu" },
  575.           { "ICC", "SUND" },
  576.           { "ice", "aWNl" },
  577.           { "icy", "aWN5" },
  578.           { "I'd", "SSdk" },
  579.           { "Ida", "SWRh" },
  580.           { "i.e", "aS5l" },
  581.           { "iii", "aWlp" },
  582.           { "Ike", "SWtl" },
  583.           { "ill", "aWxs" },
  584.           { "I'm", "SSdt" },
  585.           { "imp", "aW1w" },
  586.           { "Inc", "SW5j" },
  587.           { "ink", "aW5r" },
  588.           { "inn", "aW5u" },
  589.           { "ion", "aW9u" },
  590.           { "Ira", "SXJh" },
  591.           { "ire", "aXJl" },
  592.           { "irk", "aXJr" },
  593.           { "IRS", "SVJT" },
  594.           { "i's", "aSdz" },
  595.           { "Ito", "SXRv" },
  596.           { "ITT", "SVRU" },
  597.           { "ivy", "aXZ5" },
  598.           { "jab", "amFi" },
  599.           { "jag", "amFn" },
  600.           { "jam", "amFt" },
  601.           { "Jan", "SmFu" },
  602.           { "jar", "amFy" },
  603.           { "jaw", "amF3" },
  604.           { "jay", "amF5" },
  605.           { "Jed", "SmVk" },
  606.           { "jet", "amV0" },
  607.           { "Jew", "SmV3" },
  608.           { "jig", "amln" },
  609.           { "Jim", "Smlt" },
  610.           { "job", "am9i" },
  611.           { "Joe", "Sm9l" },
  612.           { "jog", "am9n" },
  613.           { "Jon", "Sm9u" },
  614.           { "jot", "am90" },
  615.           { "joy", "am95" },
  616.           { "j's", "aidz" },
  617.           { "jug", "anVn" },
  618.           { "jut", "anV0" },
  619.           { "Kay", "S2F5" },
  620.           { "keg", "a2Vn" },
  621.           { "ken", "a2Vu" },
  622.           { "key", "a2V5" },
  623.           { "kid", "a2lk" },
  624.           { "Kim", "S2lt" },
  625.           { "kin", "a2lu" },
  626.           { "kit", "a2l0" },
  627.           { "k's", "aydz" },
  628.           { "lab", "bGFi" },
  629.           { "lac", "bGFj" },
  630.           { "lad", "bGFk" },
  631.           { "lag", "bGFn" },
  632.           { "lam", "bGFt" },
  633.           { "Lao", "TGFv" },
  634.           { "lap", "bGFw" },
  635.           { "law", "bGF3" },
  636.           { "lax", "bGF4" },
  637.           { "lay", "bGF5" },
  638.           { "lea", "bGVh" },
  639.           { "led", "bGVk" },
  640.           { "lee", "bGVl" },
  641.           { "leg", "bGVn" },
  642.           { "Len", "TGVu" },
  643.           { "Leo", "TGVv" },
  644.           { "let", "bGV0" },
  645.           { "Lev", "TGV2" },
  646.           { "Lew", "TGV3" },
  647.           { "lew", "bGV3" },
  648.           { "lid", "bGlk" },
  649.           { "lie", "bGll" },
  650.           { "lim", "bGlt" },
  651.           { "Lin", "TGlu" },
  652.           { "lip", "bGlw" },
  653.           { "lit", "bGl0" },
  654.           { "Liz", "TGl6" },
  655.           { "lob", "bG9i" },
  656.           { "log", "bG9n" },
  657.           { "lop", "bG9w" },
  658.           { "Los", "TG9z" },
  659.           { "lot", "bG90" },
  660.           { "Lou", "TG91" },
  661.           { "low", "bG93" },
  662.           { "loy", "bG95" },
  663.           { "l's", "bCdz" },
  664.           { "LSI", "TFNJ" },
  665.           { "Ltd", "THRk" },
  666.           { "LTV", "TFRW" },
  667.           { "lug", "bHVn" },
  668.           { "lux", "bHV4" },
  669.           { "lye", "bHll" },
  670.           { "Mac", "TWFj" },
  671.           { "mad", "bWFk" },
  672.           { "Mae", "TWFl" },
  673.           { "man", "bWFu" },
  674.           { "Mao", "TWFv" },
  675.           { "map", "bWFw" },
  676.           { "mar", "bWFy" },
  677.           { "mat", "bWF0" },
  678.           { "maw", "bWF3" },
  679.           { "Max", "TWF4" },
  680.           { "max", "bWF4" },
  681.           { "may", "bWF5" },
  682.           { "MBA", "TUJB" },
  683.           { "Meg", "TWVn" },
  684.           { "Mel", "TWVs" },
  685.           { "men", "bWVu" },
  686.           { "met", "bWV0" },
  687.           { "mew", "bWV3" },
  688.           { "mid", "bWlk" },
  689.           { "mig", "bWln" },
  690.           { "min", "bWlu" },
  691.           { "MIT", "TUlU" },
  692.           { "mix", "bWl4" },
  693.           { "mob", "bW9i" },
  694.           { "Moe", "TW9l" },
  695.           { "moo", "bW9v" },
  696.           { "mop", "bW9w" },
  697.           { "mot", "bW90" },
  698.           { "mow", "bW93" },
  699.           { "MPH", "TVBI" },
  700.           { "Mrs", "TXJz" },
  701.           { "m's", "bSdz" },
  702.           { "mud", "bXVk" },
  703.           { "mug", "bXVn" },
  704.           { "mum", "bXVt" },
  705.           { "nab", "bmFi" },
  706.           { "nag", "bmFn" },
  707.           { "Nan", "TmFu" },
  708.           { "nap", "bmFw" },
  709.           { "Nat", "TmF0" },
  710.           { "nay", "bmF5" },
  711.           { "NBC", "TkJD" },
  712.           { "NBS", "TkJT" },
  713.           { "NCO", "TkNP" },
  714.           { "NCR", "TkNS" },
  715.           { "Ned", "TmVk" },
  716.           { "nee", "bmVl" },
  717.           { "net", "bmV0" },
  718.           { "new", "bmV3" },
  719.           { "nib", "bmli" },
  720.           { "NIH", "TklI" },
  721.           { "nil", "bmls" },
  722.           { "nip", "bmlw" },
  723.           { "nit", "bml0" },
  724.           { "NNE", "Tk5F" },
  725.           { "NNW", "Tk5X" },
  726.           { "nob", "bm9i" },
  727.           { "nod", "bm9k" },
  728.           { "non", "bm9u" },
  729.           { "nor", "bm9y" },
  730.           { "not", "bm90" },
  731.           { "Nov", "Tm92" },
  732.           { "now", "bm93" },
  733.           { "NRC", "TlJD" },
  734.           { "n's", "bidz" },
  735.           { "NSF", "TlNG" },
  736.           { "nun", "bnVu" },
  737.           { "nut", "bnV0" },
  738.           { "NYC", "TllD" },
  739.           { "NYU", "TllV" },
  740.           { "oaf", "b2Fm" },
  741.           { "oak", "b2Fr" },
  742.           { "oar", "b2Fy" },
  743.           { "oat", "b2F0" },
  744.           { "Oct", "T2N0" },
  745.           { "odd", "b2Rk" },
  746.           { "ode", "b2Rl" },
  747.           { "off", "b2Zm" },
  748.           { "oft", "b2Z0" },
  749.           { "ohm", "b2ht" },
  750.           { "oil", "b2ls" },
  751.           { "old", "b2xk" },
  752.           { "one", "b25l" },
  753.           { "opt", "b3B0" },
  754.           { "orb", "b3Ji" },
  755.           { "ore", "b3Jl" },
  756.           { "Orr", "T3Jy" },
  757.           { "o's", "bydz" },
  758.           { "Ott", "T3R0" },
  759.           { "our", "b3Vy" },
  760.           { "out", "b3V0" },
  761.           { "ova", "b3Zh" },
  762.           { "owe", "b3dl" },
  763.           { "owl", "b3ds" },
  764.           { "own", "b3du" },
  765.           { "pad", "cGFk" },
  766.           { "pal", "cGFs" },
  767.           { "Pam", "UGFt" },
  768.           { "pan", "cGFu" },
  769.           { "pap", "cGFw" },
  770.           { "par", "cGFy" },
  771.           { "pat", "cGF0" },
  772.           { "paw", "cGF3" },
  773.           { "pax", "cGF4" },
  774.           { "pay", "cGF5" },
  775.           { "Paz", "UGF6" },
  776.           { "PBS", "UEJT" },
  777.           { "PDP", "UERQ" },
  778.           { "pea", "cGVh" },
  779.           { "pee", "cGVl" },
  780.           { "peg", "cGVn" },
  781.           { "pen", "cGVu" },
  782.           { "pep", "cGVw" },
  783.           { "per", "cGVy" },
  784.           { "pet", "cGV0" },
  785.           { "pew", "cGV3" },
  786.           { "PhD", "UGhE" },
  787.           { "phi", "cGhp" },
  788.           { "pie", "cGll" },
  789.           { "pig", "cGln" },
  790.           { "pin", "cGlu" },
  791.           { "pip", "cGlw" },
  792.           { "pit", "cGl0" },
  793.           { "ply", "cGx5" },
  794.           { "pod", "cG9k" },
  795.           { "Poe", "UG9l" },
  796.           { "poi", "cG9p" },
  797.           { "pol", "cG9s" },
  798.           { "pop", "cG9w" },
  799.           { "pot", "cG90" },
  800.           { "pow", "cG93" },
  801.           { "ppm", "cHBt" },
  802.           { "pro", "cHJv" },
  803.           { "pry", "cHJ5" },
  804.           { "p's", "cCdz" },
  805.           { "psi", "cHNp" },
  806.           { "PTA", "UFRB" },
  807.           { "pub", "cHVi" },
  808.           { "PUC", "UFVD" },
  809.           { "pug", "cHVn" },
  810.           { "pun", "cHVu" },
  811.           { "pup", "cHVw" },
  812.           { "pus", "cHVz" },
  813.           { "put", "cHV0" },
  814.           { "PVC", "UFZD" },
  815.           { "QED", "UUVE" },
  816.           { "q's", "cSdz" },
  817.           { "qua", "cXVh" },
  818.           { "quo", "cXVv" },
  819.           { "Rae", "UmFl" },
  820.           { "rag", "cmFn" },
  821.           { "raj", "cmFq" },
  822.           { "ram", "cmFt" },
  823.           { "ran", "cmFu" },
  824.           { "rap", "cmFw" },
  825.           { "rat", "cmF0" },
  826.           { "raw", "cmF3" },
  827.           { "ray", "cmF5" },
  828.           { "RCA", "UkNB" },
  829.           { "R&D", "UiZE" },
  830.           { "reb", "cmVi" },
  831.           { "red", "cmVk" },
  832.           { "rep", "cmVw" },
  833.           { "ret", "cmV0" },
  834.           { "rev", "cmV2" },
  835.           { "Rex", "UmV4" },
  836.           { "rho", "cmhv" },
  837.           { "rib", "cmli" },
  838.           { "rid", "cmlk" },
  839.           { "rig", "cmln" },
  840.           { "rim", "cmlt" },
  841.           { "Rio", "Umlv" },
  842.           { "rip", "cmlw" },
  843.           { "RNA", "Uk5B" },
  844.           { "rob", "cm9i" },
  845.           { "rod", "cm9k" },
  846.           { "roe", "cm9l" },
  847.           { "Ron", "Um9u" },
  848.           { "rot", "cm90" },
  849.           { "row", "cm93" },
  850.           { "Roy", "Um95" },
  851.           { "RPM", "UlBN" },
  852.           { "r's", "cidz" },
  853.           { "rub", "cnVi" },
  854.           { "rue", "cnVl" },
  855.           { "rug", "cnVn" },
  856.           { "rum", "cnVt" },
  857.           { "run", "cnVu" },
  858.           { "rut", "cnV0" },
  859.           { "rye", "cnll" },
  860.           { "sac", "c2Fj" },
  861.           { "sad", "c2Fk" },
  862.           { "sag", "c2Fn" },
  863.           { "Sal", "U2Fs" },
  864.           { "Sam", "U2Ft" },
  865.           { "San", "U2Fu" },
  866.           { "Sao", "U2Fv" },
  867.           { "sap", "c2Fw" },
  868.           { "sat", "c2F0" },
  869.           { "saw", "c2F3" },
  870.           { "sax", "c2F4" },
  871.           { "say", "c2F5" },
  872.           { "Sci", "U2Np" },
  873.           { "SCM", "U0NN" },
  874.           { "sea", "c2Vh" },
  875.           { "sec", "c2Vj" },
  876.           { "see", "c2Vl" },
  877.           { "sen", "c2Vu" },
  878.           { "seq", "c2Vx" },
  879.           { "set", "c2V0" },
  880.           { "sew", "c2V3" },
  881.           { "sex", "c2V4" },
  882.           { "she", "c2hl" },
  883.           { "Shu", "U2h1" },
  884.           { "shy", "c2h5" },
  885.           { "sib", "c2li" },
  886.           { "sic", "c2lj" },
  887.           { "sin", "c2lu" },
  888.           { "sip", "c2lw" },
  889.           { "sir", "c2ly" },
  890.           { "sis", "c2lz" },
  891.           { "sit", "c2l0" },
  892.           { "six", "c2l4" },
  893.           { "ski", "c2tp" },
  894.           { "sky", "c2t5" },
  895.           { "sly", "c2x5" },
  896.           { "sob", "c29i" },
  897.           { "Soc", "U29j" },
  898.           { "sod", "c29k" },
  899.           { "Sol", "U29s" },
  900.           { "son", "c29u" },
  901.           { "sop", "c29w" },
  902.           { "sou", "c291" },
  903.           { "sow", "c293" },
  904.           { "soy", "c295" },
  905.           { "spa", "c3Bh" },
  906.           { "spy", "c3B5" },
  907.           { "Sri", "U3Jp" },
  908.           { "s's", "cydz" },
  909.           { "SSE", "U1NF" },
  910.           { "SST", "U1NU" },
  911.           { "SSW", "U1NX" },
  912.           { "Stu", "U3R1" },
  913.           { "sub", "c3Vi" },
  914.           { "sud", "c3Vk" },
  915.           { "sue", "c3Vl" },
  916.           { "sum", "c3Vt" },
  917.           { "sun", "c3Vu" },
  918.           { "sup", "c3Vw" },
  919.           { "Sus", "U3Vz" },
  920.           { "tab", "dGFi" },
  921.           { "tad", "dGFk" },
  922.           { "tag", "dGFn" },
  923.           { "tam", "dGFt" },
  924.           { "tan", "dGFu" },
  925.           { "tao", "dGFv" },
  926.           { "tap", "dGFw" },
  927.           { "tar", "dGFy" },
  928.           { "tat", "dGF0" },
  929.           { "tau", "dGF1" },
  930.           { "tax", "dGF4" },
  931.           { "tea", "dGVh" },
  932.           { "Ted", "VGVk" },
  933.           { "ted", "dGVk" },
  934.           { "tee", "dGVl" },
  935.           { "Tel", "VGVs" },
  936.           { "ten", "dGVu" },
  937.           { "the", "dGhl" },
  938.           { "thy", "dGh5" },
  939.           { "tic", "dGlj" },
  940.           { "tid", "dGlk" },
  941.           { "tie", "dGll" },
  942.           { "til", "dGls" },
  943.           { "Tim", "VGlt" },
  944.           { "tin", "dGlu" },
  945.           { "tip", "dGlw" },
  946.           { "tit", "dGl0" },
  947.           { "TNT", "VE5U" },
  948.           { "toe", "dG9l" },
  949.           { "tog", "dG9n" },
  950.           { "Tom", "VG9t" },
  951.           { "ton", "dG9u" },
  952.           { "too", "dG9v" },
  953.           { "top", "dG9w" },
  954.           { "tor", "dG9y" },
  955.           { "tot", "dG90" },
  956.           { "tow", "dG93" },
  957.           { "toy", "dG95" },
  958.           { "TRW", "VFJX" },
  959.           { "try", "dHJ5" },
  960.           { "t's", "dCdz" },
  961.           { "TTL", "VFRM" },
  962.           { "TTY", "VFRZ" },
  963.           { "tub", "dHVi" },
  964.           { "tug", "dHVn" },
  965.           { "tum", "dHVt" },
  966.           { "tun", "dHVu" },
  967.           { "TVA", "VFZB" },
  968.           { "TWA", "VFdB" },
  969.           { "two", "dHdv" },
  970.           { "TWX", "VFdY" },
  971.           { "ugh", "dWdo" },
  972.           { "UHF", "VUhG" },
  973.           { "Uri", "VXJp" },
  974.           { "urn", "dXJu" },
  975.           { "U.S", "VS5T" },
  976.           { "u's", "dSdz" },
  977.           { "USA", "VVNB" },
  978.           { "USC", "VVND" },
  979.           { "use", "dXNl" },
  980.           { "USN", "VVNO" },
  981.           { "van", "dmFu" },
  982.           { "vat", "dmF0" },
  983.           { "vee", "dmVl" },
  984.           { "vet", "dmV0" },
  985.           { "vex", "dmV4" },
  986.           { "VHF", "VkhG" },
  987.           { "via", "dmlh" },
  988.           { "vie", "dmll" },
  989.           { "vii", "dmlp" },
  990.           { "vis", "dmlz" },
  991.           { "viz", "dml6" },
  992.           { "von", "dm9u" },
  993.           { "vow", "dm93" },
  994.           { "v's", "didz" },
  995.           { "WAC", "V0FD" },
  996.           { "wad", "d2Fk" },
  997.           { "wag", "d2Fn" },
  998.           { "wah", "d2Fo" },
  999.           { "wan", "d2Fu" },
  1000.           { "war", "d2Fy" },
  1001.           { "was", "d2Fz" },
  1002.           { "wax", "d2F4" },
  1003.           { "way", "d2F5" },
  1004.           { "web", "d2Vi" },
  1005.           { "wed", "d2Vk" },
  1006.           { "wee", "d2Vl" },
  1007.           { "Wei", "V2Vp" },
  1008.           { "wet", "d2V0" },
  1009.           { "who", "d2hv" },
  1010.           { "why", "d2h5" },
  1011.           { "wig", "d2ln" },
  1012.           { "win", "d2lu" },
  1013.           { "wit", "d2l0" },
  1014.           { "woe", "d29l" },
  1015.           { "wok", "d29r" },
  1016.           { "won", "d29u" },
  1017.           { "woo", "d29v" },
  1018.           { "wop", "d29w" },
  1019.           { "wow", "d293" },
  1020.           { "wry", "d3J5" },
  1021.           { "w's", "dydz" },
  1022.           { "x's", "eCdz" },
  1023.           { "yah", "eWFo" },
  1024.           { "yak", "eWFr" },
  1025.           { "yam", "eWFt" },
  1026.           { "yap", "eWFw" },
  1027.           { "yaw", "eWF3" },
  1028.           { "yea", "eWVh" },
  1029.           { "yen", "eWVu" },
  1030.           { "yet", "eWV0" },
  1031.           { "yin", "eWlu" },
  1032.           { "yip", "eWlw" },
  1033.           { "yon", "eW9u" },
  1034.           { "you", "eW91" },
  1035.           { "yow", "eW93" },
  1036.           { "y's", "eSdz" },
  1037.           { "yuh", "eXVo" },
  1038.           { "zag", "emFn" },
  1039.           { "Zan", "WmFu" },
  1040.           { "zap", "emFw" },
  1041.           { "Zen", "WmVu" },
  1042.           { "zig", "emln" },
  1043.           { "zip", "emlw" },
  1044.           { "Zoe", "Wm9l" },
  1045.           { "zoo", "em9v" },
  1046.           { "z's", "eidz" },
  1047.           /* the false rumors file */
  1048.           { "\"So when I die, the first thing I will see in heaven is a score list?\"", 
  1049.             "IlNvIHdoZW4gSSBkaWUsIHRoZSBmaXJzdCB0aGluZyBJIHdpbGwgc2VlIGluIGhlYXZlbiBpcyBhIHNjb3JlIGxpc3Q/Ig==" },
  1050.           { "1st Law of Hacking: leaving is much more difficult than entering.", 
  1051.             "MXN0IExhdyBvZiBIYWNraW5nOiBsZWF2aW5nIGlzIG11Y2ggbW9yZSBkaWZmaWN1bHQgdGhhbiBlbnRlcmluZy4=" },
  1052.           { "2nd Law of Hacking: first in, first out.", 
  1053.             "Mm5kIExhdyBvZiBIYWNraW5nOiBmaXJzdCBpbiwgZmlyc3Qgb3V0Lg==" },
  1054.           { "3rd Law of Hacking: the last blow counts most.", 
  1055.             "M3JkIExhdyBvZiBIYWNraW5nOiB0aGUgbGFzdCBibG93IGNvdW50cyBtb3N0Lg==" },
  1056.           { "4th Law of Hacking: you will find the exit at the entrance.", 
  1057.             "NHRoIExhdyBvZiBIYWNraW5nOiB5b3Ugd2lsbCBmaW5kIHRoZSBleGl0IGF0IHRoZSBlbnRyYW5jZS4=" },
  1058.           { "A chameleon imitating a mail daemon often delivers scrolls of fire.", 
  1059.             "QSBjaGFtZWxlb24gaW1pdGF0aW5nIGEgbWFpbCBkYWVtb24gb2Z0ZW4gZGVsaXZlcnMgc2Nyb2xscyBvZiBmaXJlLg==" },
  1060.           { "A cockatrice corpse is guaranteed to be untainted!", 
  1061.             "QSBjb2NrYXRyaWNlIGNvcnBzZSBpcyBndWFyYW50ZWVkIHRvIGJlIHVudGFpbnRlZCE=" },
  1062.           { "A dead cockatrice is just a dead lizard.", 
  1063.             "QSBkZWFkIGNvY2thdHJpY2UgaXMganVzdCBhIGRlYWQgbGl6YXJkLg==" },
  1064.           { "A dragon is just a snake that ate a scroll of fire.", 
  1065.             "QSBkcmFnb24gaXMganVzdCBhIHNuYWtlIHRoYXQgYXRlIGEgc2Nyb2xsIG9mIGZpcmUu" },
  1066.           { "A fading corridor enlightens your insight.", 
  1067.             "QSBmYWRpbmcgY29ycmlkb3IgZW5saWdodGVucyB5b3VyIGluc2lnaHQu" },
  1068.           { "A glowing potion is too hot to drink.", 
  1069.             "QSBnbG93aW5nIHBvdGlvbiBpcyB0b28gaG90IHRvIGRyaW5rLg==" },
  1070.           { "A good amulet may protect you against guards.", 
  1071.             "QSBnb29kIGFtdWxldCBtYXkgcHJvdGVjdCB5b3UgYWdhaW5zdCBndWFyZHMu" },
  1072.           { "A lizard corpse is a good thing to turn undead.", 
  1073.             "QSBsaXphcmQgY29ycHNlIGlzIGEgZ29vZCB0aGluZyB0byB0dXJuIHVuZGVhZC4=" },
  1074.           { "A long worm can be defined recursively. So how should you attack it?", 
  1075.             "QSBsb25nIHdvcm0gY2FuIGJlIGRlZmluZWQgcmVjdXJzaXZlbHkuIFNvIGhvdyBzaG91bGQgeW91IGF0dGFjayBpdD8=" },
  1076.           { "A monstrous mind is a toy forever.", 
  1077.             "QSBtb25zdHJvdXMgbWluZCBpcyBhIHRveSBmb3JldmVyLg==" },
  1078.           { "A nymph will be very pleased if you call her by her real name: Lorelei.", 
  1079.             "QSBueW1waCB3aWxsIGJlIHZlcnkgcGxlYXNlZCBpZiB5b3UgY2FsbCBoZXIgYnkgaGVyIHJlYWwgbmFtZTogTG9yZWxlaS4=" },
  1080.           { "A ring of dungeon master control is a great find.", 
  1081.             "QSByaW5nIG9mIGR1bmdlb24gbWFzdGVyIGNvbnRyb2wgaXMgYSBncmVhdCBmaW5kLg==" },
  1082.           { "A ring of extra ring finger is useless if not enchanted.", 
  1083.             "QSByaW5nIG9mIGV4dHJhIHJpbmcgZmluZ2VyIGlzIHVzZWxlc3MgaWYgbm90IGVuY2hhbnRlZC4=" },
  1084.           { "A rope may form a trail in a maze.", 
  1085.             "QSByb3BlIG1heSBmb3JtIGEgdHJhaWwgaW4gYSBtYXplLg==" },
  1086.           { "A staff may recharge if you drop it for awhile.", 
  1087.             "QSBzdGFmZiBtYXkgcmVjaGFyZ2UgaWYgeW91IGRyb3AgaXQgZm9yIGF3aGlsZS4=" },
  1088.           { "A visit to the Zoo is very educational; you meet interesting animals.", 
  1089.             "QSB2aXNpdCB0byB0aGUgWm9vIGlzIHZlcnkgZWR1Y2F0aW9uYWw7IHlvdSBtZWV0IGludGVyZXN0aW5nIGFuaW1hbHMu" },
  1090.           { "A wand of deaf is a more dangerous weapon than a wand of sheep.", 
  1091.             "QSB3YW5kIG9mIGRlYWYgaXMgYSBtb3JlIGRhbmdlcm91cyB3ZWFwb24gdGhhbiBhIHdhbmQgb2Ygc2hlZXAu" },
  1092.           { "A wand of vibration might bring the whole cave crashing about your ears.", 
  1093.             "QSB3YW5kIG9mIHZpYnJhdGlvbiBtaWdodCBicmluZyB0aGUgd2hvbGUgY2F2ZSBjcmFzaGluZyBhYm91dCB5b3VyIGVhcnMu" },
  1094.           { "A winner never quits. A quitter never wins.", 
  1095.             "QSB3aW5uZXIgbmV2ZXIgcXVpdHMuIEEgcXVpdHRlciBuZXZlciB3aW5zLg==" },
  1096.           { "A wish? Okay, make me a fortune cookie!", 
  1097.             "QSB3aXNoPyBPa2F5LCBtYWtlIG1lIGEgZm9ydHVuZSBjb29raWUh" },
  1098.           { "Afraid of mimics? Try to wear a ring of true seeing.", 
  1099.             "QWZyYWlkIG9mIG1pbWljcz8gVHJ5IHRvIHdlYXIgYSByaW5nIG9mIHRydWUgc2VlaW5nLg==" },
  1100.           { "All monsters are created evil, but some are more evil than others.", 
  1101.             "QWxsIG1vbnN0ZXJzIGFyZSBjcmVhdGVkIGV2aWwsIGJ1dCBzb21lIGFyZSBtb3JlIGV2aWwgdGhhbiBvdGhlcnMu" },
  1102.           { "Always attack a floating eye from behind!", 
  1103.             "QWx3YXlzIGF0dGFjayBhIGZsb2F0aW5nIGV5ZSBmcm9tIGJlaGluZCE=" },
  1104.           { "An elven cloak is always the height of fashion.", 
  1105.             "QW4gZWx2ZW4gY2xvYWsgaXMgYWx3YXlzIHRoZSBoZWlnaHQgb2YgZmFzaGlvbi4=" },
  1106.           { "Any small object that is accidentally dropped will hide under a larger object.", 
  1107.             "QW55IHNtYWxsIG9iamVjdCB0aGF0IGlzIGFjY2lkZW50YWxseSBkcm9wcGVkIHdpbGwgaGlkZSB1bmRlciBhIGxhcmdlciBvYmplY3Qu" },
  1108.           { "Balrogs do not appear above level 20.", 
  1109.             "QmFscm9ncyBkbyBub3QgYXBwZWFyIGFib3ZlIGxldmVsIDIwLg==" },
  1110.           { "Banana peels work especially well against Keystone Kops.", 
  1111.             "QmFuYW5hIHBlZWxzIHdvcmsgZXNwZWNpYWxseSB3ZWxsIGFnYWluc3QgS2V5c3RvbmUgS29wcy4=" },
  1112.           { "Be careful when eating bananas. Monsters might slip on the peels.", 
  1113.             "QmUgY2FyZWZ1bCB3aGVuIGVhdGluZyBiYW5hbmFzLiBNb25zdGVycyBtaWdodCBzbGlwIG9uIHRoZSBwZWVscy4=" },
  1114.           { "Better leave the dungeon; otherwise you might get hurt badly.", 
  1115.             "QmV0dGVyIGxlYXZlIHRoZSBkdW5nZW9uOyBvdGhlcndpc2UgeW91IG1pZ2h0IGdldCBodXJ0IGJhZGx5Lg==" },
  1116.           { "Beware of the potion of nitroglycerin -- it's not for the weak of heart.", 
  1117.             "QmV3YXJlIG9mIHRoZSBwb3Rpb24gb2Ygbml0cm9nbHljZXJpbiAtLSBpdCdzIG5vdCBmb3IgdGhlIHdlYWsgb2YgaGVhcnQu" },
  1118.           { "Beware: there's always a chance that your wand explodes as you try to zap it!", 
  1119.             "QmV3YXJlOiB0aGVyZSdzIGFsd2F5cyBhIGNoYW5jZSB0aGF0IHlvdXIgd2FuZCBleHBsb2RlcyBhcyB5b3UgdHJ5IHRvIHphcCBpdCE=" },
  1120.           { "Beyond the 23rd level lies a happy retirement in a room of your own.", 
  1121.             "QmV5b25kIHRoZSAyM3JkIGxldmVsIGxpZXMgYSBoYXBweSByZXRpcmVtZW50IGluIGEgcm9vbSBvZiB5b3VyIG93bi4=" },
  1122.           { "Changing your suit without dropping your sword? You must be kidding!", 
  1123.             "Q2hhbmdpbmcgeW91ciBzdWl0IHdpdGhvdXQgZHJvcHBpbmcgeW91ciBzd29yZD8gWW91IG11c3QgYmUga2lkZGluZyE=" },
  1124.           { "Cockatrices might turn themselves to stone faced with a mirror.", 
  1125.             "Q29ja2F0cmljZXMgbWlnaHQgdHVybiB0aGVtc2VsdmVzIHRvIHN0b25lIGZhY2VkIHdpdGggYSBtaXJyb3Iu" },
  1126.           { "Consumption of home-made food is strictly forbidden in this dungeon.", 
  1127.             "Q29uc3VtcHRpb24gb2YgaG9tZS1tYWRlIGZvb2QgaXMgc3RyaWN0bHkgZm9yYmlkZGVuIGluIHRoaXMgZHVuZ2Vvbi4=" },
  1128.           { "Dark room? Your chance to develop your photographs!", 
  1129.             "RGFyayByb29tPyBZb3VyIGNoYW5jZSB0byBkZXZlbG9wIHlvdXIgcGhvdG9ncmFwaHMh" },
  1130.           { "Dark rooms are not *completely* dark: just wait and let your eyes adjust...", 
  1131.             "RGFyayByb29tcyBhcmUgbm90ICpjb21wbGV0ZWx5KiBkYXJrOiBqdXN0IHdhaXQgYW5kIGxldCB5b3VyIGV5ZXMgYWRqdXN0Li4u" },
  1132.           { "David London sez, \"Hey guys, *WIELD* a lizard corpse against a cockatrice!\"", 
  1133.             "RGF2aWQgTG9uZG9uIHNleiwgIkhleSBndXlzLCAqV0lFTEQqIGEgbGl6YXJkIGNvcnBzZSBhZ2FpbnN0IGEgY29ja2F0cmljZSEi" },
  1134.           { "Death is just life's way of telling you you've been fired.", 
  1135.             "RGVhdGggaXMganVzdCBsaWZlJ3Mgd2F5IG9mIHRlbGxpbmcgeW91IHlvdSd2ZSBiZWVuIGZpcmVkLg==" },
  1136.           { "Demi-gods don't need any help from the gods.", 
  1137.             "RGVtaS1nb2RzIGRvbid0IG5lZWQgYW55IGhlbHAgZnJvbSB0aGUgZ29kcy4=" },
  1138.           { "Demons *HATE* Priests and Priestesses.", 
  1139.             "RGVtb25zICpIQVRFKiBQcmllc3RzIGFuZCBQcmllc3Rlc3Nlcy4=" },
  1140.           { "Didn't you forget to pay?", 
  1141.             "RGlkbid0IHlvdSBmb3JnZXQgdG8gcGF5Pw==" },
  1142.           { "Didn't your mother tell you not to eat food off the floor?", 
  1143.             "RGlkbid0IHlvdXIgbW90aGVyIHRlbGwgeW91IG5vdCB0byBlYXQgZm9vZCBvZmYgdGhlIGZsb29yPw==" },
  1144.           { "Direct a direct hit on your direct opponent, directing in the right direction.", 
  1145.             "RGlyZWN0IGEgZGlyZWN0IGhpdCBvbiB5b3VyIGRpcmVjdCBvcHBvbmVudCwgZGlyZWN0aW5nIGluIHRoZSByaWdodCBkaXJlY3Rpb24u" },
  1146.           { "Do you want to make more money? Sure, we all do! Join the Fort Ludios guard!", 
  1147.             "RG8geW91IHdhbnQgdG8gbWFrZSBtb3JlIG1vbmV5PyBTdXJlLCB3ZSBhbGwgZG8hIEpvaW4gdGhlIEZvcnQgTHVkaW9zIGd1YXJkIQ==" },
  1148.           { "Don't eat too much: you might start hiccoughing!", 
  1149.             "RG9uJ3QgZWF0IHRvbyBtdWNoOiB5b3UgbWlnaHQgc3RhcnQgaGljY291Z2hpbmch" },
  1150.           { "Don't play hack at your work; your boss might hit you!", 
  1151.             "RG9uJ3QgcGxheSBoYWNrIGF0IHlvdXIgd29yazsgeW91ciBib3NzIG1pZ2h0IGhpdCB5b3Uh" },
  1152.           { "Don't tell a soul you found a secret door, otherwise it isn't a secret anymore.", 
  1153.             "RG9uJ3QgdGVsbCBhIHNvdWwgeW91IGZvdW5kIGEgc2VjcmV0IGRvb3IsIG90aGVyd2lzZSBpdCBpc24ndCBhIHNlY3JldCBhbnltb3JlLg==" },
  1154.           { "Drinking potions of booze may land you in jail if you are under 21.", 
  1155.             "RHJpbmtpbmcgcG90aW9ucyBvZiBib296ZSBtYXkgbGFuZCB5b3UgaW4gamFpbCBpZiB5b3UgYXJlIHVuZGVyIDIxLg==" },
  1156.           { "Drop your vanity and get rid of your jewels! Pickpockets about!", 
  1157.             "RHJvcCB5b3VyIHZhbml0eSBhbmQgZ2V0IHJpZCBvZiB5b3VyIGpld2VscyEgUGlja3BvY2tldHMgYWJvdXQh" },
  1158.           { "Eat 10 cloves of garlic and keep all humans at a two-square distance.", 
  1159.             "RWF0IDEwIGNsb3ZlcyBvZiBnYXJsaWMgYW5kIGtlZXAgYWxsIGh1bWFucyBhdCBhIHR3by1zcXVhcmUgZGlzdGFuY2Uu" },
  1160.           { "Eels hide under mud. Use a unicorn to clear the water and make them visible.", 
  1161.             "RWVscyBoaWRlIHVuZGVyIG11ZC4gVXNlIGEgdW5pY29ybiB0byBjbGVhciB0aGUgd2F0ZXIgYW5kIG1ha2UgdGhlbSB2aXNpYmxlLg==" },
  1162.           { "Engrave your wishes with a wand of wishing.", 
  1163.             "RW5ncmF2ZSB5b3VyIHdpc2hlcyB3aXRoIGEgd2FuZCBvZiB3aXNoaW5nLg==" },
  1164.           { "Eventually you will come to admire the swift elegance of a retreating nymph.", 
  1165.             "RXZlbnR1YWxseSB5b3Ugd2lsbCBjb21lIHRvIGFkbWlyZSB0aGUgc3dpZnQgZWxlZ2FuY2Ugb2YgYSByZXRyZWF0aW5nIG55bXBoLg==" },
  1166.           { "Ever heard hissing outside? I *knew* you hadn't!", 
  1167.             "RXZlciBoZWFyZCBoaXNzaW5nIG91dHNpZGU/IEkgKmtuZXcqIHlvdSBoYWRuJ3Qh" },
  1168.           { "Ever lifted a dragon corpse?", 
  1169.             "RXZlciBsaWZ0ZWQgYSBkcmFnb24gY29ycHNlPw==" },
  1170.           { "Ever seen a leocrotta dancing the tengu?", 
  1171.             "RXZlciBzZWVuIGEgbGVvY3JvdHRhIGRhbmNpbmcgdGhlIHRlbmd1Pw==" },
  1172.           { "Ever seen your weapon glow plaid?", 
  1173.             "RXZlciBzZWVuIHlvdXIgd2VhcG9uIGdsb3cgcGxhaWQ/" },
  1174.           { "Ever tamed a shopkeeper?", 
  1175.             "RXZlciB0YW1lZCBhIHNob3BrZWVwZXI/" },
  1176.           { "Ever tried digging through a Vault Guard?", 
  1177.             "RXZlciB0cmllZCBkaWdnaW5nIHRocm91Z2ggYSBWYXVsdCBHdWFyZD8=" },
  1178.           { "Ever tried enchanting a rope?", 
  1179.             "RXZlciB0cmllZCBlbmNoYW50aW5nIGEgcm9wZT8=" },
  1180.           { "Floating eyes can't stand Hawaiian shirts.", 
  1181.             "RmxvYXRpbmcgZXllcyBjYW4ndCBzdGFuZCBIYXdhaWlhbiBzaGlydHMu" },
  1182.           { "For any remedy there is a misery.", 
  1183.             "Rm9yIGFueSByZW1lZHkgdGhlcmUgaXMgYSBtaXNlcnku" },
  1184.           { "Giant bats turn into giant vampires.", 
  1185.             "R2lhbnQgYmF0cyB0dXJuIGludG8gZ2lhbnQgdmFtcGlyZXMu" },
  1186.           { "Good day for overcoming obstacles. Try a steeplechase.", 
  1187.             "R29vZCBkYXkgZm9yIG92ZXJjb21pbmcgb2JzdGFjbGVzLiBUcnkgYSBzdGVlcGxlY2hhc2Uu" },
  1188.           { "Half Moon tonight. (At least it's better than no Moon at all.)", 
  1189.             "SGFsZiBNb29uIHRvbmlnaHQuIChBdCBsZWFzdCBpdCdzIGJldHRlciB0aGFuIG5vIE1vb24gYXQgYWxsLik=" },
  1190.           { "Help! I'm being held prisoner in a fortune cookie factory!", 
  1191.             "SGVscCEgSSdtIGJlaW5nIGhlbGQgcHJpc29uZXIgaW4gYSBmb3J0dW5lIGNvb2tpZSBmYWN0b3J5IQ==" },
  1192.           { "Housecats have nine lives, kittens only one.", 
  1193.             "SG91c2VjYXRzIGhhdmUgbmluZSBsaXZlcywga2l0dGVucyBvbmx5IG9uZS4=" },
  1194.           { "How long can you tread water?", 
  1195.             "SG93IGxvbmcgY2FuIHlvdSB0cmVhZCB3YXRlcj8=" },
  1196.           { "Hungry? There is an abundance of food on the next level.", 
  1197.             "SHVuZ3J5PyBUaGVyZSBpcyBhbiBhYnVuZGFuY2Ugb2YgZm9vZCBvbiB0aGUgbmV4dCBsZXZlbC4=" },
  1198.           { "I guess you've never hit a mail daemon with the Amulet of Yendor...", 
  1199.             "SSBndWVzcyB5b3UndmUgbmV2ZXIgaGl0IGEgbWFpbCBkYWVtb24gd2l0aCB0aGUgQW11bGV0IG9mIFllbmRvci4uLg==" },
  1200.           { "If you are the shopkeeper, you can take things for free.", 
  1201.             "SWYgeW91IGFyZSB0aGUgc2hvcGtlZXBlciwgeW91IGNhbiB0YWtlIHRoaW5ncyBmb3IgZnJlZS4=" },
  1202.           { "If you can't learn to do it well, learn to enjoy doing it badly.", 
  1203.             "SWYgeW91IGNhbid0IGxlYXJuIHRvIGRvIGl0IHdlbGwsIGxlYXJuIHRvIGVuam95IGRvaW5nIGl0IGJhZGx5Lg==" },
  1204.           { "If you thought the Wizard was bad, just wait till you meet the Warlord!", 
  1205.             "SWYgeW91IHRob3VnaHQgdGhlIFdpemFyZCB3YXMgYmFkLCBqdXN0IHdhaXQgdGlsbCB5b3UgbWVldCB0aGUgV2FybG9yZCE=" },
  1206.           { "If you turn blind, don't expect your dog to be turned into a seeing-eye dog.", 
  1207.             "SWYgeW91IHR1cm4gYmxpbmQsIGRvbid0IGV4cGVjdCB5b3VyIGRvZyB0byBiZSB0dXJuZWQgaW50byBhIHNlZWluZy1leWUgZG9nLg==" },
  1208.           { "If you want to feel great, you must eat something real big.", 
  1209.             "SWYgeW91IHdhbnQgdG8gZmVlbCBncmVhdCwgeW91IG11c3QgZWF0IHNvbWV0aGluZyByZWFsIGJpZy4=" },
  1210.           { "If you want to float, you'd better eat a floating eye.", 
  1211.             "SWYgeW91IHdhbnQgdG8gZmxvYXQsIHlvdSdkIGJldHRlciBlYXQgYSBmbG9hdGluZyBleWUu" },
  1212.           { "If your ghost kills a player, it increases your score.", 
  1213.             "SWYgeW91ciBnaG9zdCBraWxscyBhIHBsYXllciwgaXQgaW5jcmVhc2VzIHlvdXIgc2NvcmUu" },
  1214.           { "Increase mindpower: Tame your own ghost!", 
  1215.             "SW5jcmVhc2UgbWluZHBvd2VyOiBUYW1lIHlvdXIgb3duIGdob3N0IQ==" },
  1216.           { "It furthers one to see the great man.", 
  1217.             "SXQgZnVydGhlcnMgb25lIHRvIHNlZSB0aGUgZ3JlYXQgbWFuLg==" },
  1218.           { "It's easy to overlook a monster in a wood.", 
  1219.             "SXQncyBlYXN5IHRvIG92ZXJsb29rIGEgbW9uc3RlciBpbiBhIHdvb2Qu" },
  1220.           { "Just below any trapdoor there may be another one. Just keep falling!", 
  1221.             "SnVzdCBiZWxvdyBhbnkgdHJhcGRvb3IgdGhlcmUgbWF5IGJlIGFub3RoZXIgb25lLiBKdXN0IGtlZXAgZmFsbGluZyE=" },
  1222.           { "Katanas are very sharp; watch you don't cut yourself.", 
  1223.             "S2F0YW5hcyBhcmUgdmVyeSBzaGFycDsgd2F0Y2ggeW91IGRvbid0IGN1dCB5b3Vyc2VsZi4=" },
  1224.           { "Keep a clear mind: quaff clear potions.", 
  1225.             "S2VlcCBhIGNsZWFyIG1pbmQ6IHF1YWZmIGNsZWFyIHBvdGlvbnMu" },
  1226.           { "Kicking the terminal doesn't hurt the monsters.", 
  1227.             "S2lja2luZyB0aGUgdGVybWluYWwgZG9lc24ndCBodXJ0IHRoZSBtb25zdGVycy4=" },
  1228.           { "Killer bees keep appearing till you kill their queen.", 
  1229.             "S2lsbGVyIGJlZXMga2VlcCBhcHBlYXJpbmcgdGlsbCB5b3Uga2lsbCB0aGVpciBxdWVlbi4=" },
  1230.           { "Killer bunnies can be tamed with carrots only.", 
  1231.             "S2lsbGVyIGJ1bm5pZXMgY2FuIGJlIHRhbWVkIHdpdGggY2Fycm90cyBvbmx5Lg==" },
  1232.           { "Latest news? Put `rec.games.roguelike.nethack' in your .newsrc!", 
  1233.             "TGF0ZXN0IG5ld3M/IFB1dCBgcmVjLmdhbWVzLnJvZ3VlbGlrZS5uZXRoYWNrJyBpbiB5b3VyIC5uZXdzcmMh" },
  1234.           { "Learn how to spell. Play NetHack!", 
  1235.             "TGVhcm4gaG93IHRvIHNwZWxsLiBQbGF5IE5ldEhhY2sh" },
  1236.           { "Leprechauns hide their gold in a secret room.", 
  1237.             "TGVwcmVjaGF1bnMgaGlkZSB0aGVpciBnb2xkIGluIGEgc2VjcmV0IHJvb20u" },
  1238.           { "Let your fingers do the walking on the yulkjhnb keys.", 
  1239.             "TGV0IHlvdXIgZmluZ2VycyBkbyB0aGUgd2Fsa2luZyBvbiB0aGUgeXVsa2pobmIga2V5cy4=" },
  1240.           { "Let's face it: this time you're not going to win.", 
  1241.             "TGV0J3MgZmFjZSBpdDogdGhpcyB0aW1lIHlvdSdyZSBub3QgZ29pbmcgdG8gd2luLg==" },
  1242.           { "Let's have a party, drink a lot of booze.", 
  1243.             "TGV0J3MgaGF2ZSBhIHBhcnR5LCBkcmluayBhIGxvdCBvZiBib296ZS4=" },
  1244.           { "Liquor sellers do not drink; they hate to see you twice.", 
  1245.             "TGlxdW9yIHNlbGxlcnMgZG8gbm90IGRyaW5rOyB0aGV5IGhhdGUgdG8gc2VlIHlvdSB0d2ljZS4=" },
  1246.           { "Lunar eclipse tonight. May as well quit now!", 
  1247.             "THVuYXIgZWNsaXBzZSB0b25pZ2h0LiBNYXkgYXMgd2VsbCBxdWl0IG5vdyE=" },
  1248.           { "Meeting your own ghost decreases your luck considerably!", 
  1249.             "TWVldGluZyB5b3VyIG93biBnaG9zdCBkZWNyZWFzZXMgeW91ciBsdWNrIGNvbnNpZGVyYWJseSE=" },
  1250.           { "Money to invest? Take it to the local branch of the Magic Memory Vault!", 
  1251.             "TW9uZXkgdG8gaW52ZXN0PyBUYWtlIGl0IHRvIHRoZSBsb2NhbCBicmFuY2ggb2YgdGhlIE1hZ2ljIE1lbW9yeSBWYXVsdCE=" },
  1252.           { "Monsters come from nowhere to hit you everywhere.", 
  1253.             "TW9uc3RlcnMgY29tZSBmcm9tIG5vd2hlcmUgdG8gaGl0IHlvdSBldmVyeXdoZXJlLg==" },
  1254.           { "Monsters sleep because you are boring, not because they ever get tired.", 
  1255.             "TW9uc3RlcnMgc2xlZXAgYmVjYXVzZSB5b3UgYXJlIGJvcmluZywgbm90IGJlY2F1c2UgdGhleSBldmVyIGdldCB0aXJlZC4=" },
  1256.           { "Most monsters prefer minced meat. That's why they are hitting you!", 
  1257.             "TW9zdCBtb25zdGVycyBwcmVmZXIgbWluY2VkIG1lYXQuIFRoYXQncyB3aHkgdGhleSBhcmUgaGl0dGluZyB5b3Uh" },
  1258.           { "Most of the bugs in NetHack are on the floor.", 
  1259.             "TW9zdCBvZiB0aGUgYnVncyBpbiBOZXRIYWNrIGFyZSBvbiB0aGUgZmxvb3Iu" },
  1260.           { "Much ado Nothing Happens.", 
  1261.             "TXVjaCBhZG8gTm90aGluZyBIYXBwZW5zLg==" },
  1262.           { "Multi-player NetHack is a myth.", 
  1263.             "TXVsdGktcGxheWVyIE5ldEhhY2sgaXMgYSBteXRoLg==" },
  1264.           { "NetHack is addictive. Too late, you're already hooked.", 
  1265.             "TmV0SGFjayBpcyBhZGRpY3RpdmUuIFRvbyBsYXRlLCB5b3UncmUgYWxyZWFkeSBob29rZWQu" },
  1266.           { "Never ask a shopkeeper for a price list.", 
  1267.             "TmV2ZXIgYXNrIGEgc2hvcGtlZXBlciBmb3IgYSBwcmljZSBsaXN0Lg==" },
  1268.           { "Never burn a tree, unless you like getting whacked with a +5 shovel.", 
  1269.             "TmV2ZXIgYnVybiBhIHRyZWUsIHVubGVzcyB5b3UgbGlrZSBnZXR0aW5nIHdoYWNrZWQgd2l0aCBhICs1IHNob3ZlbC4=" },
  1270.           { "Never eat with glowing hands!", 
  1271.             "TmV2ZXIgZWF0IHdpdGggZ2xvd2luZyBoYW5kcyE=" },
  1272.           { "Never mind the monsters hitting you: they just replace the charwomen.", 
  1273.             "TmV2ZXIgbWluZCB0aGUgbW9uc3RlcnMgaGl0dGluZyB5b3U6IHRoZXkganVzdCByZXBsYWNlIHRoZSBjaGFyd29tZW4u" },
  1274.           { "Never play leapfrog with a unicorn.", 
  1275.             "TmV2ZXIgcGxheSBsZWFwZnJvZyB3aXRoIGEgdW5pY29ybi4=" },
  1276.           { "Never step on a cursed engraving.", 
  1277.             "TmV2ZXIgc3RlcCBvbiBhIGN1cnNlZCBlbmdyYXZpbmcu" },
  1278.           { "Never swim with a camera: there's nothing to take pictures of.", 
  1279.             "TmV2ZXIgc3dpbSB3aXRoIGEgY2FtZXJhOiB0aGVyZSdzIG5vdGhpbmcgdG8gdGFrZSBwaWN0dXJlcyBvZi4=" },
  1280.           { "Never teach your pet rust monster to fetch.", 
  1281.             "TmV2ZXIgdGVhY2ggeW91ciBwZXQgcnVzdCBtb25zdGVyIHRvIGZldGNoLg==" },
  1282.           { "Never trust a random generator in magic fields.", 
  1283.             "TmV2ZXIgdHJ1c3QgYSByYW5kb20gZ2VuZXJhdG9yIGluIG1hZ2ljIGZpZWxkcy4=" },
  1284.           { "Never use a wand of death.", 
  1285.             "TmV2ZXIgdXNlIGEgd2FuZCBvZiBkZWF0aC4=" },
  1286.           { "No level contains two shops. The maze is no level. So...", 
  1287.             "Tm8gbGV2ZWwgY29udGFpbnMgdHdvIHNob3BzLiBUaGUgbWF6ZSBpcyBubyBsZXZlbC4gU28uLi4=" },
  1288.           { "No part of this fortune may be reproduced, stored in a retrieval system, ...", 
  1289.             "Tm8gcGFydCBvZiB0aGlzIGZvcnR1bmUgbWF5IGJlIHJlcHJvZHVjZWQsIHN0b3JlZCBpbiBhIHJldHJpZXZhbCBzeXN0ZW0sIC4uLg==" },
  1290.           { "Not all rumors are as misleading as this one.", 
  1291.             "Tm90IGFsbCBydW1vcnMgYXJlIGFzIG1pc2xlYWRpbmcgYXMgdGhpcyBvbmUu" },
  1292.           { "Nymphs and nurses like beautiful rings.", 
  1293.             "TnltcGhzIGFuZCBudXJzZXMgbGlrZSBiZWF1dGlmdWwgcmluZ3Mu" },
  1294.           { "Nymphs are blondes. Are you a gentleman?", 
  1295.             "TnltcGhzIGFyZSBibG9uZGVzLiBBcmUgeW91IGEgZ2VudGxlbWFuPw==" },
  1296.           { "Offering a unicorn a worthless piece of glass might prove to be fatal!", 
  1297.             "T2ZmZXJpbmcgYSB1bmljb3JuIGEgd29ydGhsZXNzIHBpZWNlIG9mIGdsYXNzIG1pZ2h0IHByb3ZlIHRvIGJlIGZhdGFsIQ==" },
  1298.           { "Old hackers never die: young ones do.", 
  1299.             "T2xkIGhhY2tlcnMgbmV2ZXIgZGllOiB5b3VuZyBvbmVzIGRvLg==" },
  1300.           { "One has to leave shops before closing time.", 
  1301.             "T25lIGhhcyB0byBsZWF2ZSBzaG9wcyBiZWZvcmUgY2xvc2luZyB0aW1lLg==" },
  1302.           { "One homunculus a day keeps the doctor away.", 
  1303.             "T25lIGhvbXVuY3VsdXMgYSBkYXkga2VlcHMgdGhlIGRvY3RvciBhd2F5Lg==" },
  1304.           { "One level further down somebody is getting killed, right now.", 
  1305.             "T25lIGxldmVsIGZ1cnRoZXIgZG93biBzb21lYm9keSBpcyBnZXR0aW5nIGtpbGxlZCwgcmlnaHQgbm93Lg==" },
  1306.           { "Only a wizard can use a magic whistle.", 
  1307.             "T25seSBhIHdpemFyZCBjYW4gdXNlIGEgbWFnaWMgd2hpc3RsZS4=" },
  1308.           { "Only adventurers of evil alignment think of killing their dog.", 
  1309.             "T25seSBhZHZlbnR1cmVycyBvZiBldmlsIGFsaWdubWVudCB0aGluayBvZiBraWxsaW5nIHRoZWlyIGRvZy4=" },
  1310.           { "Only chaotic evils kill sleeping monsters.", 
  1311.             "T25seSBjaGFvdGljIGV2aWxzIGtpbGwgc2xlZXBpbmcgbW9uc3RlcnMu" },
  1312.           { "Only real trappers escape traps.", 
  1313.             "T25seSByZWFsIHRyYXBwZXJzIGVzY2FwZSB0cmFwcy4=" },
  1314.           { "Only real wizards can write scrolls.", 
  1315.             "T25seSByZWFsIHdpemFyZHMgY2FuIHdyaXRlIHNjcm9sbHMu" },
  1316.           { "Operation OVERKILL has started now.", 
  1317.             "T3BlcmF0aW9uIE9WRVJLSUxMIGhhcyBzdGFydGVkIG5vdy4=" },
  1318.           { "PLEASE ignore previous rumor.", 
  1319.             "UExFQVNFIGlnbm9yZSBwcmV2aW91cyBydW1vci4=" },
  1320.           { "Polymorph into an ettin; meet your opponents face to face to face.", 
  1321.             "UG9seW1vcnBoIGludG8gYW4gZXR0aW47IG1lZXQgeW91ciBvcHBvbmVudHMgZmFjZSB0byBmYWNlIHRvIGZhY2Uu" },
  1322.           { "Praying will frighten demons.", 
  1323.             "UHJheWluZyB3aWxsIGZyaWdodGVuIGRlbW9ucy4=" },
  1324.           { "Row (3x) that boat gently down the stream, Charon (4x), death is but a dream.", 
  1325.             "Um93ICgzeCkgdGhhdCBib2F0IGdlbnRseSBkb3duIHRoZSBzdHJlYW0sIENoYXJvbiAoNHgpLCBkZWF0aCBpcyBidXQgYSBkcmVhbS4=" },
  1326.           { "Running is good for your legs.", 
  1327.             "UnVubmluZyBpcyBnb29kIGZvciB5b3VyIGxlZ3Mu" },
  1328.           { "Screw up your courage! You've screwed up everything else.", 
  1329.             "U2NyZXcgdXAgeW91ciBjb3VyYWdlISBZb3UndmUgc2NyZXdlZCB1cCBldmVyeXRoaW5nIGVsc2Uu" },
  1330.           { "Seepage? Leaky pipes? Rising damp? Summon the plumber!", 
  1331.             "U2VlcGFnZT8gTGVha3kgcGlwZXM/IFJpc2luZyBkYW1wPyBTdW1tb24gdGhlIHBsdW1iZXIh" },
  1332.           { "Segmentation fault (core dumped).", 
  1333.             "U2VnbWVudGF0aW9uIGZhdWx0IChjb3JlIGR1bXBlZCku" },
  1334.           { "Shopkeepers sometimes die from old age.", 
  1335.             "U2hvcGtlZXBlcnMgc29tZXRpbWVzIGRpZSBmcm9tIG9sZCBhZ2Uu" },
  1336.           { "Some mazes (especially small ones) have no solutions, says man 6 maze.", 
  1337.             "U29tZSBtYXplcyAoZXNwZWNpYWxseSBzbWFsbCBvbmVzKSBoYXZlIG5vIHNvbHV0aW9ucywgc2F5cyBtYW4gNiBtYXplLg==" },
  1338.           { "Some questions the Sphynx asks just *don't* have any answers.", 
  1339.             "U29tZSBxdWVzdGlvbnMgdGhlIFNwaHlueCBhc2tzIGp1c3QgKmRvbid0KiBoYXZlIGFueSBhbnN3ZXJzLg==" },
  1340.           { "Sometimes \"mu\" is the answer.", 
  1341.             "U29tZXRpbWVzICJtdSIgaXMgdGhlIGFuc3dlci4=" },
  1342.           { "Sorry, no fortune this time. Better luck next cookie!", 
  1343.             "U29ycnksIG5vIGZvcnR1bmUgdGhpcyB0aW1lLiBCZXR0ZXIgbHVjayBuZXh0IGNvb2tpZSE=" },
  1344.           { "Spare your scrolls of make-edible until it's really necessary!", 
  1345.             "U3BhcmUgeW91ciBzY3JvbGxzIG9mIG1ha2UtZWRpYmxlIHVudGlsIGl0J3MgcmVhbGx5IG5lY2Vzc2FyeSE=" },
  1346.           { "Suddenly, the dungeon will collapse...", 
  1347.             "U3VkZGVubHksIHRoZSBkdW5nZW9uIHdpbGwgY29sbGFwc2UuLi4=" },
  1348.           { "Taming a mail daemon may cause a system security violation.", 
  1349.             "VGFtaW5nIGEgbWFpbCBkYWVtb24gbWF5IGNhdXNlIGEgc3lzdGVtIHNlY3VyaXR5IHZpb2xhdGlvbi4=" },
  1350.           { "The crowd was so tough, the Stooges won't play the Dungeon anymore, nyuk nyuk.", 
  1351.             "VGhlIGNyb3dkIHdhcyBzbyB0b3VnaCwgdGhlIFN0b29nZXMgd29uJ3QgcGxheSB0aGUgRHVuZ2VvbiBhbnltb3JlLCBueXVrIG55dWsu" },
  1352.           { "The leprechauns hide their treasure in a small hidden room.", 
  1353.             "VGhlIGxlcHJlY2hhdW5zIGhpZGUgdGhlaXIgdHJlYXN1cmUgaW4gYSBzbWFsbCBoaWRkZW4gcm9vbS4=" },
  1354.           { "The longer the wand the better.", 
  1355.             "VGhlIGxvbmdlciB0aGUgd2FuZCB0aGUgYmV0dGVyLg==" },
  1356.           { "The magic word is \"XYZZY\".", 
  1357.             "VGhlIG1hZ2ljIHdvcmQgaXMgIlhZWlpZIi4=" },
  1358.           { "The meek shall inherit your bones files.", 
  1359.             "VGhlIG1lZWsgc2hhbGwgaW5oZXJpdCB5b3VyIGJvbmVzIGZpbGVzLg==" },
  1360.           { "The mines are dark and deep, and I have levels to go before I sleep.", 
  1361.             "VGhlIG1pbmVzIGFyZSBkYXJrIGFuZCBkZWVwLCBhbmQgSSBoYXZlIGxldmVscyB0byBnbyBiZWZvcmUgSSBzbGVlcC4=" },
  1362.           { "The use of dynamite is dangerous.", 
  1363.             "VGhlIHVzZSBvZiBkeW5hbWl0ZSBpcyBkYW5nZXJvdXMu" },
  1364.           { "There are no worms in the UNIX version.", 
  1365.             "VGhlcmUgYXJlIG5vIHdvcm1zIGluIHRoZSBVTklYIHZlcnNpb24u" },
  1366.           { "There is a trap on this level!", 
  1367.             "VGhlcmUgaXMgYSB0cmFwIG9uIHRoaXMgbGV2ZWwh" },
  1368.           { "They say that Demogorgon, Asmodeus, Orcus, Yeenoghu & Juiblex is no law firm.", 
  1369.             "VGhleSBzYXkgdGhhdCBEZW1vZ29yZ29uLCBBc21vZGV1cywgT3JjdXMsIFllZW5vZ2h1ICYgSnVpYmxleCBpcyBubyBsYXcgZmlybS4=" },
  1370.           { "They say that Geryon has an evil twin, beware!", 
  1371.             "VGhleSBzYXkgdGhhdCBHZXJ5b24gaGFzIGFuIGV2aWwgdHdpbiwgYmV3YXJlIQ==" },
  1372.           { "They say that Medusa would make a terrible pet.", 
  1373.             "VGhleSBzYXkgdGhhdCBNZWR1c2Egd291bGQgbWFrZSBhIHRlcnJpYmxlIHBldC4=" },
  1374.           { "They say that NetHack bugs are Seldon planned.", 
  1375.             "VGhleSBzYXkgdGhhdCBOZXRIYWNrIGJ1Z3MgYXJlIFNlbGRvbiBwbGFubmVkLg==" },
  1376.           { "They say that NetHack comes in 256 flavors.", 
  1377.             "VGhleSBzYXkgdGhhdCBOZXRIYWNrIGNvbWVzIGluIDI1NiBmbGF2b3JzLg==" },
  1378.           { "They say that NetHack is just a computer game.", 
  1379.             "VGhleSBzYXkgdGhhdCBOZXRIYWNrIGlzIGp1c3QgYSBjb21wdXRlciBnYW1lLg==" },
  1380.           { "They say that NetHack is more than just a computer game.", 
  1381.             "VGhleSBzYXkgdGhhdCBOZXRIYWNrIGlzIG1vcmUgdGhhbiBqdXN0IGEgY29tcHV0ZXIgZ2FtZS4=" },
  1382.           { "They say that NetHack is never what it used to be.", 
  1383.             "VGhleSBzYXkgdGhhdCBOZXRIYWNrIGlzIG5ldmVyIHdoYXQgaXQgdXNlZCB0byBiZS4=" },
  1384.           { "They say that a baby dragon is too small to hurt or help you.", 
  1385.             "VGhleSBzYXkgdGhhdCBhIGJhYnkgZHJhZ29uIGlzIHRvbyBzbWFsbCB0byBodXJ0IG9yIGhlbHAgeW91Lg==" },
  1386.           { "They say that a black pudding is simply a brown pudding gone bad.", 
  1387.             "VGhleSBzYXkgdGhhdCBhIGJsYWNrIHB1ZGRpbmcgaXMgc2ltcGx5IGEgYnJvd24gcHVkZGluZyBnb25lIGJhZC4=" },
  1388.           { "They say that a black sheep has 3 bags full of wool.", 
  1389.             "VGhleSBzYXkgdGhhdCBhIGJsYWNrIHNoZWVwIGhhcyAzIGJhZ3MgZnVsbCBvZiB3b29sLg==" },
  1390.           { "They say that a blank scroll is like a blank check.", 
  1391.             "VGhleSBzYXkgdGhhdCBhIGJsYW5rIHNjcm9sbCBpcyBsaWtlIGEgYmxhbmsgY2hlY2su" },
  1392.           { "They say that a cat named Morris has nine lives.", 
  1393.             "VGhleSBzYXkgdGhhdCBhIGNhdCBuYW1lZCBNb3JyaXMgaGFzIG5pbmUgbGl2ZXMu" },
  1394.           { "They say that a desperate shopper might pay any price in a shop.", 
  1395.             "VGhleSBzYXkgdGhhdCBhIGRlc3BlcmF0ZSBzaG9wcGVyIG1pZ2h0IHBheSBhbnkgcHJpY2UgaW4gYSBzaG9wLg==" },
  1396.           { "They say that a diamond dog is everybody's best friend.", 
  1397.             "VGhleSBzYXkgdGhhdCBhIGRpYW1vbmQgZG9nIGlzIGV2ZXJ5Ym9keSdzIGJlc3QgZnJpZW5kLg==" },
  1398.           { "They say that a dwarf lord can carry a pick-axe because his armor is light.", 
  1399.             "VGhleSBzYXkgdGhhdCBhIGR3YXJmIGxvcmQgY2FuIGNhcnJ5IGEgcGljay1heGUgYmVjYXVzZSBoaXMgYXJtb3IgaXMgbGlnaHQu" },
  1400.           { "They say that a floating eye can defeat Medusa.", 
  1401.             "VGhleSBzYXkgdGhhdCBhIGZsb2F0aW5nIGV5ZSBjYW4gZGVmZWF0IE1lZHVzYS4=" },
  1402.           { "They say that a fortune only has 1 line and you can't read between it.", 
  1403.             "VGhleSBzYXkgdGhhdCBhIGZvcnR1bmUgb25seSBoYXMgMSBsaW5lIGFuZCB5b3UgY2FuJ3QgcmVhZCBiZXR3ZWVuIGl0Lg==" },
  1404.           { "They say that a fortune only has 1 line, but you can read between it.", 
  1405.             "VGhleSBzYXkgdGhhdCBhIGZvcnR1bmUgb25seSBoYXMgMSBsaW5lLCBidXQgeW91IGNhbiByZWFkIGJldHdlZW4gaXQu" },
  1406.           { "They say that a fountain looks nothing like a regularly erupting geyser.", 
  1407.             "VGhleSBzYXkgdGhhdCBhIGZvdW50YWluIGxvb2tzIG5vdGhpbmcgbGlrZSBhIHJlZ3VsYXJseSBlcnVwdGluZyBnZXlzZXIu" },
  1408.           { "They say that a gold doubloon is worth more than its weight in gold.", 
  1409.             "VGhleSBzYXkgdGhhdCBhIGdvbGQgZG91Ymxvb24gaXMgd29ydGggbW9yZSB0aGFuIGl0cyB3ZWlnaHQgaW4gZ29sZC4=" },
  1410.           { "They say that a grid bug won't pay a shopkeeper for zapping you in a shop.", 
  1411.             "VGhleSBzYXkgdGhhdCBhIGdyaWQgYnVnIHdvbid0IHBheSBhIHNob3BrZWVwZXIgZm9yIHphcHBpbmcgeW91IGluIGEgc2hvcC4=" },
  1412.           { "They say that a gypsy could tell your fortune for a price.", 
  1413.             "VGhleSBzYXkgdGhhdCBhIGd5cHN5IGNvdWxkIHRlbGwgeW91ciBmb3J0dW5lIGZvciBhIHByaWNlLg==" },
  1414.           { "They say that a hacker named Alice once level teleported by using a mirror.", 
  1415.             "VGhleSBzYXkgdGhhdCBhIGhhY2tlciBuYW1lZCBBbGljZSBvbmNlIGxldmVsIHRlbGVwb3J0ZWQgYnkgdXNpbmcgYSBtaXJyb3Iu" },
  1416.           { "They say that a hacker named David once slew a giant with a sling and a rock.", 
  1417.             "VGhleSBzYXkgdGhhdCBhIGhhY2tlciBuYW1lZCBEYXZpZCBvbmNlIHNsZXcgYSBnaWFudCB3aXRoIGEgc2xpbmcgYW5kIGEgcm9jay4=" },
  1418.           { "They say that a hacker named Dorothy once rode a fog cloud to Oz.", 
  1419.             "VGhleSBzYXkgdGhhdCBhIGhhY2tlciBuYW1lZCBEb3JvdGh5IG9uY2Ugcm9kZSBhIGZvZyBjbG91ZCB0byBPei4=" },
  1420.           { "They say that a hacker named Mary once lost a white sheep in the mazes.", 
  1421.             "VGhleSBzYXkgdGhhdCBhIGhhY2tlciBuYW1lZCBNYXJ5IG9uY2UgbG9zdCBhIHdoaXRlIHNoZWVwIGluIHRoZSBtYXplcy4=" },
  1422.           { "They say that a helm of brilliance is not to be taken lightly.", 
  1423.             "VGhleSBzYXkgdGhhdCBhIGhlbG0gb2YgYnJpbGxpYW5jZSBpcyBub3QgdG8gYmUgdGFrZW4gbGlnaHRseS4=" },
  1424.           { "They say that a hot dog and a hell hound are the same thing.", 
  1425.             "VGhleSBzYXkgdGhhdCBhIGhvdCBkb2cgYW5kIGEgaGVsbCBob3VuZCBhcmUgdGhlIHNhbWUgdGhpbmcu" },
  1426.           { "They say that a lamp named Aladdin's Lamp contains a djinni with 3 wishes.", 
  1427.             "VGhleSBzYXkgdGhhdCBhIGxhbXAgbmFtZWQgQWxhZGRpbidzIExhbXAgY29udGFpbnMgYSBkamlubmkgd2l0aCAzIHdpc2hlcy4=" },
  1428.           { "They say that a large dog named Lassie will lead you to the amulet.", 
  1429.             "VGhleSBzYXkgdGhhdCBhIGxhcmdlIGRvZyBuYW1lZCBMYXNzaWUgd2lsbCBsZWFkIHlvdSB0byB0aGUgYW11bGV0Lg==" },
  1430.           { "They say that a long sword is not a light sword.", 
  1431.             "VGhleSBzYXkgdGhhdCBhIGxvbmcgc3dvcmQgaXMgbm90IGEgbGlnaHQgc3dvcmQu" },
  1432.           { "They say that a manes won't mince words with you.", 
  1433.             "VGhleSBzYXkgdGhhdCBhIG1hbmVzIHdvbid0IG1pbmNlIHdvcmRzIHdpdGggeW91Lg==" },
  1434.           { "They say that a mind is a terrible thing to waste.", 
  1435.             "VGhleSBzYXkgdGhhdCBhIG1pbmQgaXMgYSB0ZXJyaWJsZSB0aGluZyB0byB3YXN0ZS4=" },
  1436.           { "They say that a plain nymph will only wear a wire ring in one ear.", 
  1437.             "VGhleSBzYXkgdGhhdCBhIHBsYWluIG55bXBoIHdpbGwgb25seSB3ZWFyIGEgd2lyZSByaW5nIGluIG9uZSBlYXIu" },
  1438.           { "They say that a plumed hat could be a previously used crested helmet.", 
  1439.             "VGhleSBzYXkgdGhhdCBhIHBsdW1lZCBoYXQgY291bGQgYmUgYSBwcmV2aW91c2x5IHVzZWQgY3Jlc3RlZCBoZWxtZXQu" },
  1440.           { "They say that a potion of oil is difficult to grasp.", 
  1441.             "VGhleSBzYXkgdGhhdCBhIHBvdGlvbiBvZiBvaWwgaXMgZGlmZmljdWx0IHRvIGdyYXNwLg==" },
  1442.           { "They say that a potion of yogurt is a cancelled potion of sickness.", 
  1443.             "VGhleSBzYXkgdGhhdCBhIHBvdGlvbiBvZiB5b2d1cnQgaXMgYSBjYW5jZWxsZWQgcG90aW9uIG9mIHNpY2tuZXNzLg==" },
  1444.           { "They say that a purple worm is not a baby purple dragon.", 
  1445.             "VGhleSBzYXkgdGhhdCBhIHB1cnBsZSB3b3JtIGlzIG5vdCBhIGJhYnkgcHVycGxlIGRyYWdvbi4=" },
  1446.           { "They say that a quivering blob tastes different than a gelatinous cube.", 
  1447.             "VGhleSBzYXkgdGhhdCBhIHF1aXZlcmluZyBibG9iIHRhc3RlcyBkaWZmZXJlbnQgdGhhbiBhIGdlbGF0aW5vdXMgY3ViZS4=" },
  1448.           { "They say that a runed broadsword named Stormbringer attracts vortices.", 
  1449.             "VGhleSBzYXkgdGhhdCBhIHJ1bmVkIGJyb2Fkc3dvcmQgbmFtZWQgU3Rvcm1icmluZ2VyIGF0dHJhY3RzIHZvcnRpY2VzLg==" },
  1450.           { "They say that a scroll of summoning has other names.", 
  1451.             "VGhleSBzYXkgdGhhdCBhIHNjcm9sbCBvZiBzdW1tb25pbmcgaGFzIG90aGVyIG5hbWVzLg==" },
  1452.           { "They say that a shaman can bestow blessings but usually doesn't.", 
  1453.             "VGhleSBzYXkgdGhhdCBhIHNoYW1hbiBjYW4gYmVzdG93IGJsZXNzaW5ncyBidXQgdXN1YWxseSBkb2Vzbid0Lg==" },
  1454.           { "They say that a shaman will bless you for an eye of newt and wing of bat.", 
  1455.             "VGhleSBzYXkgdGhhdCBhIHNoYW1hbiB3aWxsIGJsZXNzIHlvdSBmb3IgYW4gZXllIG9mIG5ld3QgYW5kIHdpbmcgb2YgYmF0Lg==" },
  1456.           { "They say that a shimmering gold shield is not a polished silver shield.", 
  1457.             "VGhleSBzYXkgdGhhdCBhIHNoaW1tZXJpbmcgZ29sZCBzaGllbGQgaXMgbm90IGEgcG9saXNoZWQgc2lsdmVyIHNoaWVsZC4=" },
  1458.           { "They say that a spear will hit a neo-otyugh. (Do YOU know what that is?)", 
  1459.             "VGhleSBzYXkgdGhhdCBhIHNwZWFyIHdpbGwgaGl0IGEgbmVvLW90eXVnaC4gKERvIFlPVSBrbm93IHdoYXQgdGhhdCBpcz8p" },
  1460.           { "They say that a spotted dragon is the ultimate shape changer.", 
  1461.             "VGhleSBzYXkgdGhhdCBhIHNwb3R0ZWQgZHJhZ29uIGlzIHRoZSB1bHRpbWF0ZSBzaGFwZSBjaGFuZ2VyLg==" },
  1462.           { "They say that a stethoscope is no good if you can only hear your heartbeat.", 
  1463.             "VGhleSBzYXkgdGhhdCBhIHN0ZXRob3Njb3BlIGlzIG5vIGdvb2QgaWYgeW91IGNhbiBvbmx5IGhlYXIgeW91ciBoZWFydGJlYXQu" },
  1464.           { "They say that a succubus named Suzy will sometimes warn you of danger.", 
  1465.             "VGhleSBzYXkgdGhhdCBhIHN1Y2N1YnVzIG5hbWVkIFN1enkgd2lsbCBzb21ldGltZXMgd2FybiB5b3Ugb2YgZGFuZ2VyLg==" },
  1466.           { "They say that a wand of cancellation is not like a wand of polymorph.", 
  1467.             "VGhleSBzYXkgdGhhdCBhIHdhbmQgb2YgY2FuY2VsbGF0aW9uIGlzIG5vdCBsaWtlIGEgd2FuZCBvZiBwb2x5bW9ycGgu" },
  1468.           { "They say that a wood golem named Pinocchio would be easy to control.", 
  1469.             "VGhleSBzYXkgdGhhdCBhIHdvb2QgZ29sZW0gbmFtZWQgUGlub2NjaGlvIHdvdWxkIGJlIGVhc3kgdG8gY29udHJvbC4=" },
  1470.           { "They say that after killing a dragon it's time for a change of scenery.", 
  1471.             "VGhleSBzYXkgdGhhdCBhZnRlciBraWxsaW5nIGEgZHJhZ29uIGl0J3MgdGltZSBmb3IgYSBjaGFuZ2Ugb2Ygc2NlbmVyeS4=" },
  1472.           { "They say that an amulet of strangulation is worse than ring around the collar.", 
  1473.             "VGhleSBzYXkgdGhhdCBhbiBhbXVsZXQgb2Ygc3RyYW5ndWxhdGlvbiBpcyB3b3JzZSB0aGFuIHJpbmcgYXJvdW5kIHRoZSBjb2xsYXIu" },
  1474.           { "They say that an attic is the best place to hide your toys.", 
  1475.             "VGhleSBzYXkgdGhhdCBhbiBhdHRpYyBpcyB0aGUgYmVzdCBwbGFjZSB0byBoaWRlIHlvdXIgdG95cy4=" },
  1476.           { "They say that an axe named Cleaver once belonged to a hacker named Beaver.", 
  1477.             "VGhleSBzYXkgdGhhdCBhbiBheGUgbmFtZWQgQ2xlYXZlciBvbmNlIGJlbG9uZ2VkIHRvIGEgaGFja2VyIG5hbWVkIEJlYXZlci4=" },
  1478.           { "They say that an eye of newt and a wing of bat are double the trouble.", 
  1479.             "VGhleSBzYXkgdGhhdCBhbiBleWUgb2YgbmV3dCBhbmQgYSB3aW5nIG9mIGJhdCBhcmUgZG91YmxlIHRoZSB0cm91YmxlLg==" },
  1480.           { "They say that an incubus named Izzy sometimes makes women feel sensitive.", 
  1481.             "VGhleSBzYXkgdGhhdCBhbiBpbmN1YnVzIG5hbWVkIEl6enkgc29tZXRpbWVzIG1ha2VzIHdvbWVuIGZlZWwgc2Vuc2l0aXZlLg==" },
  1482.           { "They say that an opulent throne room is rarely a place to wish you'd be in.", 
  1483.             "VGhleSBzYXkgdGhhdCBhbiBvcHVsZW50IHRocm9uZSByb29tIGlzIHJhcmVseSBhIHBsYWNlIHRvIHdpc2ggeW91J2QgYmUgaW4u" },
  1484.           { "They say that an unlucky hacker once had a nose bleed at an altar and died.", 
  1485.             "VGhleSBzYXkgdGhhdCBhbiB1bmx1Y2t5IGhhY2tlciBvbmNlIGhhZCBhIG5vc2UgYmxlZWQgYXQgYW4gYWx0YXIgYW5kIGRpZWQu" },
  1486.           { "They say that and they say this but they never say never, never!", 
  1487.             "VGhleSBzYXkgdGhhdCBhbmQgdGhleSBzYXkgdGhpcyBidXQgdGhleSBuZXZlciBzYXkgbmV2ZXIsIG5ldmVyIQ==" },
  1488.           { "They say that any quantum mechanic knows that speed kills.", 
  1489.             "VGhleSBzYXkgdGhhdCBhbnkgcXVhbnR1bSBtZWNoYW5pYyBrbm93cyB0aGF0IHNwZWVkIGtpbGxzLg==" },
  1490.           { "They say that applying a unicorn horn means you've missed the point.", 
  1491.             "VGhleSBzYXkgdGhhdCBhcHBseWluZyBhIHVuaWNvcm4gaG9ybiBtZWFucyB5b3UndmUgbWlzc2VkIHRoZSBwb2ludC4=" },
  1492.           { "They say that blue stones are radioactive, beware.", 
  1493.             "VGhleSBzYXkgdGhhdCBibHVlIHN0b25lcyBhcmUgcmFkaW9hY3RpdmUsIGJld2FyZS4=" },
  1494.           { "They say that building a dungeon is a team effort.", 
  1495.             "VGhleSBzYXkgdGhhdCBidWlsZGluZyBhIGR1bmdlb24gaXMgYSB0ZWFtIGVmZm9ydC4=" },
  1496.           { "They say that chaotic characters never get a kick out of altars.", 
  1497.             "VGhleSBzYXkgdGhhdCBjaGFvdGljIGNoYXJhY3RlcnMgbmV2ZXIgZ2V0IGEga2ljayBvdXQgb2YgYWx0YXJzLg==" },
  1498.           { "They say that collapsing a dungeon often creates a panic.", 
  1499.             "VGhleSBzYXkgdGhhdCBjb2xsYXBzaW5nIGEgZHVuZ2VvbiBvZnRlbiBjcmVhdGVzIGEgcGFuaWMu" },
  1500.           { "They say that counting your eggs before they hatch shows that you care.", 
  1501.             "VGhleSBzYXkgdGhhdCBjb3VudGluZyB5b3VyIGVnZ3MgYmVmb3JlIHRoZXkgaGF0Y2ggc2hvd3MgdGhhdCB5b3UgY2FyZS4=" },
  1502.           { "They say that dipping a bag of tricks in a fountain won't make it an icebox.", 
  1503.             "VGhleSBzYXkgdGhhdCBkaXBwaW5nIGEgYmFnIG9mIHRyaWNrcyBpbiBhIGZvdW50YWluIHdvbid0IG1ha2UgaXQgYW4gaWNlYm94Lg==" },
  1504.           { "They say that dipping an eel and brown mold in hot water makes bouillabaisse.", 
  1505.             "VGhleSBzYXkgdGhhdCBkaXBwaW5nIGFuIGVlbCBhbmQgYnJvd24gbW9sZCBpbiBob3Qgd2F0ZXIgbWFrZXMgYm91aWxsYWJhaXNzZS4=" },
  1506.           { "They say that donating a doubloon is extremely pious charity.", 
  1507.             "VGhleSBzYXkgdGhhdCBkb25hdGluZyBhIGRvdWJsb29uIGlzIGV4dHJlbWVseSBwaW91cyBjaGFyaXR5Lg==" },
  1508.           { "They say that eating royal jelly attracts grizzly owlbears.", 
  1509.             "VGhleSBzYXkgdGhhdCBlYXRpbmcgcm95YWwgamVsbHkgYXR0cmFjdHMgZ3JpenpseSBvd2xiZWFycy4=" },
  1510.           { "They say that eggs, pancakes and juice are just a mundane breakfast.", 
  1511.             "VGhleSBzYXkgdGhhdCBlZ2dzLCBwYW5jYWtlcyBhbmQganVpY2UgYXJlIGp1c3QgYSBtdW5kYW5lIGJyZWFrZmFzdC4=" },
  1512.           { "They say that everyone knows why Medusa stands alone in the dark.", 
  1513.             "VGhleSBzYXkgdGhhdCBldmVyeW9uZSBrbm93cyB3aHkgTWVkdXNhIHN0YW5kcyBhbG9uZSBpbiB0aGUgZGFyay4=" },
  1514.           { "They say that everyone wanted rec.games.hack to undergo a name change.", 
  1515.             "VGhleSBzYXkgdGhhdCBldmVyeW9uZSB3YW50ZWQgcmVjLmdhbWVzLmhhY2sgdG8gdW5kZXJnbyBhIG5hbWUgY2hhbmdlLg==" },
  1516.           { "They say that finding a winning strategy is a deliberate move on your part.", 
  1517.             "VGhleSBzYXkgdGhhdCBmaW5kaW5nIGEgd2lubmluZyBzdHJhdGVneSBpcyBhIGRlbGliZXJhdGUgbW92ZSBvbiB5b3VyIHBhcnQu" },
  1518.           { "They say that finding worthless glass is worth something.", 
  1519.             "VGhleSBzYXkgdGhhdCBmaW5kaW5nIHdvcnRobGVzcyBnbGFzcyBpcyB3b3J0aCBzb21ldGhpbmcu" },
  1520.           { "They say that fortune cookies are food for thought.", 
  1521.             "VGhleSBzYXkgdGhhdCBmb3J0dW5lIGNvb2tpZXMgYXJlIGZvb2QgZm9yIHRob3VnaHQu" },
  1522.           { "They say that gold is only wasted on a pet dragon.", 
  1523.             "VGhleSBzYXkgdGhhdCBnb2xkIGlzIG9ubHkgd2FzdGVkIG9uIGEgcGV0IGRyYWdvbi4=" },
  1524.           { "They say that good things come to those that wait.", 
  1525.             "VGhleSBzYXkgdGhhdCBnb29kIHRoaW5ncyBjb21lIHRvIHRob3NlIHRoYXQgd2FpdC4=" },
  1526.           { "They say that greased objects will slip out of monsters' hands.", 
  1527.             "VGhleSBzYXkgdGhhdCBncmVhc2VkIG9iamVjdHMgd2lsbCBzbGlwIG91dCBvZiBtb25zdGVycycgaGFuZHMu" },
  1528.           { "They say that if you can't spell then you'll wish you had a spell book.", 
  1529.             "VGhleSBzYXkgdGhhdCBpZiB5b3UgY2FuJ3Qgc3BlbGwgdGhlbiB5b3UnbGwgd2lzaCB5b3UgaGFkIGEgc3BlbGwgYm9vay4=" },
  1530.           { "They say that if you live by the sword, you'll die by the sword.", 
  1531.             "VGhleSBzYXkgdGhhdCBpZiB5b3UgbGl2ZSBieSB0aGUgc3dvcmQsIHlvdSdsbCBkaWUgYnkgdGhlIHN3b3JkLg==" },
  1532.           { "They say that if you play like a monster you'll have a better game.", 
  1533.             "VGhleSBzYXkgdGhhdCBpZiB5b3UgcGxheSBsaWtlIGEgbW9uc3RlciB5b3UnbGwgaGF2ZSBhIGJldHRlciBnYW1lLg==" },
  1534.           { "They say that if you sleep with a demon you might awake with a headache.", 
  1535.             "VGhleSBzYXkgdGhhdCBpZiB5b3Ugc2xlZXAgd2l0aCBhIGRlbW9uIHlvdSBtaWdodCBhd2FrZSB3aXRoIGEgaGVhZGFjaGUu" },
  1536.           { "They say that if you step on a crack you could break your mother's back.", 
  1537.             "VGhleSBzYXkgdGhhdCBpZiB5b3Ugc3RlcCBvbiBhIGNyYWNrIHlvdSBjb3VsZCBicmVhayB5b3VyIG1vdGhlcidzIGJhY2su" },
  1538.           { "They say that if you're invisible you can still be heard!", 
  1539.             "VGhleSBzYXkgdGhhdCBpZiB5b3UncmUgaW52aXNpYmxlIHlvdSBjYW4gc3RpbGwgYmUgaGVhcmQh" },
  1540.           { "They say that if you're lucky you can feel the runes on a scroll.", 
  1541.             "VGhleSBzYXkgdGhhdCBpZiB5b3UncmUgbHVja3kgeW91IGNhbiBmZWVsIHRoZSBydW5lcyBvbiBhIHNjcm9sbC4=" },
  1542.           { "They say that in the big picture gold is only small change.", 
  1543.             "VGhleSBzYXkgdGhhdCBpbiB0aGUgYmlnIHBpY3R1cmUgZ29sZCBpcyBvbmx5IHNtYWxsIGNoYW5nZS4=" },
  1544.           { "They say that in the dungeon it's not what you know that really matters.", 
  1545.             "VGhleSBzYXkgdGhhdCBpbiB0aGUgZHVuZ2VvbiBpdCdzIG5vdCB3aGF0IHlvdSBrbm93IHRoYXQgcmVhbGx5IG1hdHRlcnMu" },
  1546.           { "They say that in the dungeon moon rocks are really dilithium crystals.", 
  1547.             "VGhleSBzYXkgdGhhdCBpbiB0aGUgZHVuZ2VvbiBtb29uIHJvY2tzIGFyZSByZWFsbHkgZGlsaXRoaXVtIGNyeXN0YWxzLg==" },
  1548.           { "They say that in the dungeon the boorish customer is never right.", 
  1549.             "VGhleSBzYXkgdGhhdCBpbiB0aGUgZHVuZ2VvbiB0aGUgYm9vcmlzaCBjdXN0b21lciBpcyBuZXZlciByaWdodC4=" },
  1550.           { "They say that in the dungeon you don't need a watch to tell time.", 
  1551.             "VGhleSBzYXkgdGhhdCBpbiB0aGUgZHVuZ2VvbiB5b3UgZG9uJ3QgbmVlZCBhIHdhdGNoIHRvIHRlbGwgdGltZS4=" },
  1552.           { "They say that in the dungeon you need something old, new, burrowed and blue.", 
  1553.             "VGhleSBzYXkgdGhhdCBpbiB0aGUgZHVuZ2VvbiB5b3UgbmVlZCBzb21ldGhpbmcgb2xkLCBuZXcsIGJ1cnJvd2VkIGFuZCBibHVlLg==" },
  1554.           { "They say that in the dungeon you should always count your blessings.", 
  1555.             "VGhleSBzYXkgdGhhdCBpbiB0aGUgZHVuZ2VvbiB5b3Ugc2hvdWxkIGFsd2F5cyBjb3VudCB5b3VyIGJsZXNzaW5ncy4=" },
  1556.           { "They say that iron golem plate mail isn't worth wishing for.", 
  1557.             "VGhleSBzYXkgdGhhdCBpcm9uIGdvbGVtIHBsYXRlIG1haWwgaXNuJ3Qgd29ydGggd2lzaGluZyBmb3Iu" },
  1558.           { "They say that it takes four quarterstaffs to make one staff.", 
  1559.             "VGhleSBzYXkgdGhhdCBpdCB0YWtlcyBmb3VyIHF1YXJ0ZXJzdGFmZnMgdG8gbWFrZSBvbmUgc3RhZmYu" },
  1560.           { "They say that it's not over till the fat ladies sing.", 
  1561.             "VGhleSBzYXkgdGhhdCBpdCdzIG5vdCBvdmVyIHRpbGwgdGhlIGZhdCBsYWRpZXMgc2luZy4=" },
  1562.           { "They say that it's not over till the fat lady shouts `Off with its head'.", 
  1563.             "VGhleSBzYXkgdGhhdCBpdCdzIG5vdCBvdmVyIHRpbGwgdGhlIGZhdCBsYWR5IHNob3V0cyBgT2ZmIHdpdGggaXRzIGhlYWQnLg==" },
  1564.           { "They say that kicking a heavy statue is really a dumb move.", 
  1565.             "VGhleSBzYXkgdGhhdCBraWNraW5nIGEgaGVhdnkgc3RhdHVlIGlzIHJlYWxseSBhIGR1bWIgbW92ZS4=" },
  1566.           { "They say that kicking a valuable gem doesn't seem to make sense.", 
  1567.             "VGhleSBzYXkgdGhhdCBraWNraW5nIGEgdmFsdWFibGUgZ2VtIGRvZXNuJ3Qgc2VlbSB0byBtYWtlIHNlbnNlLg==" },
  1568.           { "They say that leprechauns know Latin and you should too.", 
  1569.             "VGhleSBzYXkgdGhhdCBsZXByZWNoYXVucyBrbm93IExhdGluIGFuZCB5b3Ugc2hvdWxkIHRvby4=" },
  1570.           { "They say that minotaurs get lost outside of the mazes.", 
  1571.             "VGhleSBzYXkgdGhhdCBtaW5vdGF1cnMgZ2V0IGxvc3Qgb3V0c2lkZSBvZiB0aGUgbWF6ZXMu" },
  1572.           { "They say that most trolls are born again.", 
  1573.             "VGhleSBzYXkgdGhhdCBtb3N0IHRyb2xscyBhcmUgYm9ybiBhZ2Fpbi4=" },
  1574.           { "They say that naming your cat Garfield will make you more attractive.", 
  1575.             "VGhleSBzYXkgdGhhdCBuYW1pbmcgeW91ciBjYXQgR2FyZmllbGQgd2lsbCBtYWtlIHlvdSBtb3JlIGF0dHJhY3RpdmUu" },
  1576.           { "They say that no one knows everything about everything in the dungeon.", 
  1577.             "VGhleSBzYXkgdGhhdCBubyBvbmUga25vd3MgZXZlcnl0aGluZyBhYm91dCBldmVyeXRoaW5nIGluIHRoZSBkdW5nZW9uLg==" },
  1578.           { "They say that no one plays NetHack just for the fun of it.", 
  1579.             "VGhleSBzYXkgdGhhdCBubyBvbmUgcGxheXMgTmV0SGFjayBqdXN0IGZvciB0aGUgZnVuIG9mIGl0Lg==" },
  1580.           { "They say that no one really subscribes to rec.games.roguelike.nethack.", 
  1581.             "VGhleSBzYXkgdGhhdCBubyBvbmUgcmVhbGx5IHN1YnNjcmliZXMgdG8gcmVjLmdhbWVzLnJvZ3VlbGlrZS5uZXRoYWNrLg==" },
  1582.           { "They say that no one will admit to starting a rumor.", 
  1583.             "VGhleSBzYXkgdGhhdCBubyBvbmUgd2lsbCBhZG1pdCB0byBzdGFydGluZyBhIHJ1bW9yLg==" },
  1584.           { "They say that nurses sometimes carry scalpels and never use them.", 
  1585.             "VGhleSBzYXkgdGhhdCBudXJzZXMgc29tZXRpbWVzIGNhcnJ5IHNjYWxwZWxzIGFuZCBuZXZlciB1c2UgdGhlbS4=" },
  1586.           { "They say that once you've met one wizard you've met them all.", 
  1587.             "VGhleSBzYXkgdGhhdCBvbmNlIHlvdSd2ZSBtZXQgb25lIHdpemFyZCB5b3UndmUgbWV0IHRoZW0gYWxsLg==" },
  1588.           { "They say that one troll is worth 10,000 newts.", 
  1589.             "VGhleSBzYXkgdGhhdCBvbmUgdHJvbGwgaXMgd29ydGggMTAsMDAwIG5ld3RzLg==" },
  1590.           { "They say that only David can find the zoo!", 
  1591.             "VGhleSBzYXkgdGhhdCBvbmx5IERhdmlkIGNhbiBmaW5kIHRoZSB6b28h" },
  1592.           { "They say that only angels play their harps for their pets.", 
  1593.             "VGhleSBzYXkgdGhhdCBvbmx5IGFuZ2VscyBwbGF5IHRoZWlyIGhhcnBzIGZvciB0aGVpciBwZXRzLg==" },
  1594.           { "They say that only big spenders carry gold.", 
  1595.             "VGhleSBzYXkgdGhhdCBvbmx5IGJpZyBzcGVuZGVycyBjYXJyeSBnb2xkLg==" },
  1596.           { "They say that orc shamans are healthy, wealthy and wise.", 
  1597.             "VGhleSBzYXkgdGhhdCBvcmMgc2hhbWFucyBhcmUgaGVhbHRoeSwgd2VhbHRoeSBhbmQgd2lzZS4=" },
  1598.           { "They say that playing NetHack is like walking into a death trap.", 
  1599.             "VGhleSBzYXkgdGhhdCBwbGF5aW5nIE5ldEhhY2sgaXMgbGlrZSB3YWxraW5nIGludG8gYSBkZWF0aCB0cmFwLg==" },
  1600.           { "They say that problem breathing is best treated by a proper diet.", 
  1601.             "VGhleSBzYXkgdGhhdCBwcm9ibGVtIGJyZWF0aGluZyBpcyBiZXN0IHRyZWF0ZWQgYnkgYSBwcm9wZXIgZGlldC4=" },
  1602.           { "They say that quaffing many potions of levitation can give you a headache.", 
  1603.             "VGhleSBzYXkgdGhhdCBxdWFmZmluZyBtYW55IHBvdGlvbnMgb2YgbGV2aXRhdGlvbiBjYW4gZ2l2ZSB5b3UgYSBoZWFkYWNoZS4=" },
  1604.           { "They say that queen bees get that way by eating royal jelly.", 
  1605.             "VGhleSBzYXkgdGhhdCBxdWVlbiBiZWVzIGdldCB0aGF0IHdheSBieSBlYXRpbmcgcm95YWwgamVsbHku" },
  1606.           { "They say that reading a scare monster scroll is the same as saying Elbereth.", 
  1607.             "VGhleSBzYXkgdGhhdCByZWFkaW5nIGEgc2NhcmUgbW9uc3RlciBzY3JvbGwgaXMgdGhlIHNhbWUgYXMgc2F5aW5nIEVsYmVyZXRoLg==" },
  1608.           { "They say that real hackers always are controlled.", 
  1609.             "VGhleSBzYXkgdGhhdCByZWFsIGhhY2tlcnMgYWx3YXlzIGFyZSBjb250cm9sbGVkLg==" },
  1610.           { "They say that real hackers never sleep.", 
  1611.             "VGhleSBzYXkgdGhhdCByZWFsIGhhY2tlcnMgbmV2ZXIgc2xlZXAu" },
  1612.           { "They say that shopkeepers are insured by Croesus himself!", 
  1613.             "VGhleSBzYXkgdGhhdCBzaG9wa2VlcGVycyBhcmUgaW5zdXJlZCBieSBDcm9lc3VzIGhpbXNlbGYh" },
  1614.           { "They say that shopkeepers never carry more than 20 gold pieces, at night.", 
  1615.             "VGhleSBzYXkgdGhhdCBzaG9wa2VlcGVycyBuZXZlciBjYXJyeSBtb3JlIHRoYW4gMjAgZ29sZCBwaWVjZXMsIGF0IG5pZ2h0Lg==" },
  1616.           { "They say that shopkeepers never sell blessed potions of invisibility.", 
  1617.             "VGhleSBzYXkgdGhhdCBzaG9wa2VlcGVycyBuZXZlciBzZWxsIGJsZXNzZWQgcG90aW9ucyBvZiBpbnZpc2liaWxpdHku" },
  1618.           { "They say that soldiers wear kid gloves and silly helmets.", 
  1619.             "VGhleSBzYXkgdGhhdCBzb2xkaWVycyB3ZWFyIGtpZCBnbG92ZXMgYW5kIHNpbGx5IGhlbG1ldHMu" },
  1620.           { "They say that some Kops are on the take.", 
  1621.             "VGhleSBzYXkgdGhhdCBzb21lIEtvcHMgYXJlIG9uIHRoZSB0YWtlLg==" },
  1622.           { "They say that some guards' palms can be greased.", 
  1623.             "VGhleSBzYXkgdGhhdCBzb21lIGd1YXJkcycgcGFsbXMgY2FuIGJlIGdyZWFzZWQu" },
  1624.           { "They say that some monsters may kiss your boots to stop your drum playing.", 
  1625.             "VGhleSBzYXkgdGhhdCBzb21lIG1vbnN0ZXJzIG1heSBraXNzIHlvdXIgYm9vdHMgdG8gc3RvcCB5b3VyIGRydW0gcGxheWluZy4=" },
  1626.           { "They say that sometimes you can be the hit of the party when playing a horn.", 
  1627.             "VGhleSBzYXkgdGhhdCBzb21ldGltZXMgeW91IGNhbiBiZSB0aGUgaGl0IG9mIHRoZSBwYXJ0eSB3aGVuIHBsYXlpbmcgYSBob3JuLg==" },
  1628.           { "They say that the NetHack gods generally welcome your sacrifices.", 
  1629.             "VGhleSBzYXkgdGhhdCB0aGUgTmV0SGFjayBnb2RzIGdlbmVyYWxseSB3ZWxjb21lIHlvdXIgc2FjcmlmaWNlcy4=" },
  1630.           { "They say that the Three Rings are named Vilya, Nenya and Narya.", 
  1631.             "VGhleSBzYXkgdGhhdCB0aGUgVGhyZWUgUmluZ3MgYXJlIG5hbWVkIFZpbHlhLCBOZW55YSBhbmQgTmFyeWEu" },
  1632.           { "They say that the Wizard of Yendor has a death wish.", 
  1633.             "VGhleSBzYXkgdGhhdCB0aGUgV2l6YXJkIG9mIFllbmRvciBoYXMgYSBkZWF0aCB3aXNoLg==" },
  1634.           { "They say that the `hair of the dog' is sometimes an effective remedy.", 
  1635.             "VGhleSBzYXkgdGhhdCB0aGUgYGhhaXIgb2YgdGhlIGRvZycgaXMgc29tZXRpbWVzIGFuIGVmZmVjdGl2ZSByZW1lZHku" },
  1636.           { "They say that the best time to save your game is now before its too late.", 
  1637.             "VGhleSBzYXkgdGhhdCB0aGUgYmVzdCB0aW1lIHRvIHNhdmUgeW91ciBnYW1lIGlzIG5vdyBiZWZvcmUgaXRzIHRvbyBsYXRlLg==" },
  1638.           { "They say that the biggest obstacle in NetHack is your mind.", 
  1639.             "VGhleSBzYXkgdGhhdCB0aGUgYmlnZ2VzdCBvYnN0YWNsZSBpbiBOZXRIYWNrIGlzIHlvdXIgbWluZC4=" },
  1640.           { "They say that the gods are angry when they hit you with objects.", 
  1641.             "VGhleSBzYXkgdGhhdCB0aGUgZ29kcyBhcmUgYW5ncnkgd2hlbiB0aGV5IGhpdCB5b3Ugd2l0aCBvYmplY3RzLg==" },
  1642.           { "They say that the priesthood are specially favored by the gods.", 
  1643.             "VGhleSBzYXkgdGhhdCB0aGUgcHJpZXN0aG9vZCBhcmUgc3BlY2lhbGx5IGZhdm9yZWQgYnkgdGhlIGdvZHMu" },
  1644.           { "They say that the way to make a unicorn happy is to give it what it wants.", 
  1645.             "VGhleSBzYXkgdGhhdCB0aGUgd2F5IHRvIG1ha2UgYSB1bmljb3JuIGhhcHB5IGlzIHRvIGdpdmUgaXQgd2hhdCBpdCB3YW50cy4=" },
  1646.           { "They say that there are no black or white stones, only gray.", 
  1647.             "VGhleSBzYXkgdGhhdCB0aGVyZSBhcmUgbm8gYmxhY2sgb3Igd2hpdGUgc3RvbmVzLCBvbmx5IGdyYXku" },
  1648.           { "They say that there are no skeletons hence there are no skeleton keys.", 
  1649.             "VGhleSBzYXkgdGhhdCB0aGVyZSBhcmUgbm8gc2tlbGV0b25zIGhlbmNlIHRoZXJlIGFyZSBubyBza2VsZXRvbiBrZXlzLg==" },
  1650.           { "They say that there is a clever rogue in every hacker just dying to escape.", 
  1651.             "VGhleSBzYXkgdGhhdCB0aGVyZSBpcyBhIGNsZXZlciByb2d1ZSBpbiBldmVyeSBoYWNrZXIganVzdCBkeWluZyB0byBlc2NhcGUu" },
  1652.           { "They say that there is no such thing as free advice.", 
  1653.             "VGhleSBzYXkgdGhhdCB0aGVyZSBpcyBubyBzdWNoIHRoaW5nIGFzIGZyZWUgYWR2aWNlLg==" },
  1654.           { "They say that there is only one way to win at NetHack.", 
  1655.             "VGhleSBzYXkgdGhhdCB0aGVyZSBpcyBvbmx5IG9uZSB3YXkgdG8gd2luIGF0IE5ldEhhY2su" },
  1656.           { "They say that there once was a fearsome chaotic samurai named Luk No.", 
  1657.             "VGhleSBzYXkgdGhhdCB0aGVyZSBvbmNlIHdhcyBhIGZlYXJzb21lIGNoYW90aWMgc2FtdXJhaSBuYW1lZCBMdWsgTm8u" },
  1658.           { "They say that there was a time when cursed holy water wasn't water.", 
  1659.             "VGhleSBzYXkgdGhhdCB0aGVyZSB3YXMgYSB0aW1lIHdoZW4gY3Vyc2VkIGhvbHkgd2F0ZXIgd2Fzbid0IHdhdGVyLg==" },
  1660.           { "They say that there's no point in crying over a gray ooze.", 
  1661.             "VGhleSBzYXkgdGhhdCB0aGVyZSdzIG5vIHBvaW50IGluIGNyeWluZyBvdmVyIGEgZ3JheSBvb3plLg==" },
  1662.           { "They say that there's only hope left after you've opened Pandora's box.", 
  1663.             "VGhleSBzYXkgdGhhdCB0aGVyZSdzIG9ubHkgaG9wZSBsZWZ0IGFmdGVyIHlvdSd2ZSBvcGVuZWQgUGFuZG9yYSdzIGJveC4=" },
  1664.           { "They say that trapdoors should always be marked `Caution: Trap Door'.", 
  1665.             "VGhleSBzYXkgdGhhdCB0cmFwZG9vcnMgc2hvdWxkIGFsd2F5cyBiZSBtYXJrZWQgYENhdXRpb246IFRyYXAgRG9vcicu" },
  1666.           { "They say that using an amulet of change isn't a difficult operation.", 
  1667.             "VGhleSBzYXkgdGhhdCB1c2luZyBhbiBhbXVsZXQgb2YgY2hhbmdlIGlzbid0IGEgZGlmZmljdWx0IG9wZXJhdGlvbi4=" },
  1668.           { "They say that water walking boots are better if you are fast like Hermes.", 
  1669.             "VGhleSBzYXkgdGhhdCB3YXRlciB3YWxraW5nIGJvb3RzIGFyZSBiZXR0ZXIgaWYgeW91IGFyZSBmYXN0IGxpa2UgSGVybWVzLg==" },
  1670.           { "They say that when you wear a circular amulet you might resemble a troll.", 
  1671.             "VGhleSBzYXkgdGhhdCB3aGVuIHlvdSB3ZWFyIGEgY2lyY3VsYXIgYW11bGV0IHlvdSBtaWdodCByZXNlbWJsZSBhIHRyb2xsLg==" },
  1672.           { "They say that when you're hungry you can get a pizza in 30 moves or it's free.", 
  1673.             "VGhleSBzYXkgdGhhdCB3aGVuIHlvdSdyZSBodW5ncnkgeW91IGNhbiBnZXQgYSBwaXp6YSBpbiAzMCBtb3ZlcyBvciBpdCdzIGZyZWUu" },
  1674.           { "They say that when your god is angry you should try another one.", 
  1675.             "VGhleSBzYXkgdGhhdCB3aGVuIHlvdXIgZ29kIGlzIGFuZ3J5IHlvdSBzaG91bGQgdHJ5IGFub3RoZXIgb25lLg==" },
  1676.           { "They say that wielding a unicorn horn takes strength.", 
  1677.             "VGhleSBzYXkgdGhhdCB3aWVsZGluZyBhIHVuaWNvcm4gaG9ybiB0YWtlcyBzdHJlbmd0aC4=" },
  1678.           { "They say that with speed boots you never worry about hit and run accidents.", 
  1679.             "VGhleSBzYXkgdGhhdCB3aXRoIHNwZWVkIGJvb3RzIHlvdSBuZXZlciB3b3JyeSBhYm91dCBoaXQgYW5kIHJ1biBhY2NpZGVudHMu" },
  1680.           { "They say that you can defeat a killer bee with a unicorn horn.", 
  1681.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuIGRlZmVhdCBhIGtpbGxlciBiZWUgd2l0aCBhIHVuaWNvcm4gaG9ybi4=" },
  1682.           { "They say that you can only cross the River Styx in Charon's boat.", 
  1683.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuIG9ubHkgY3Jvc3MgdGhlIFJpdmVyIFN0eXggaW4gQ2hhcm9uJ3MgYm9hdC4=" },
  1684.           { "They say that you can only kill a lich once and then you'd better be careful.", 
  1685.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuIG9ubHkga2lsbCBhIGxpY2ggb25jZSBhbmQgdGhlbiB5b3UnZCBiZXR0ZXIgYmUgY2FyZWZ1bC4=" },
  1686.           { "They say that you can only wish for things you've already had.", 
  1687.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuIG9ubHkgd2lzaCBmb3IgdGhpbmdzIHlvdSd2ZSBhbHJlYWR5IGhhZC4=" },
  1688.           { "They say that you can train a cat by talking gently to it.", 
  1689.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuIHRyYWluIGEgY2F0IGJ5IHRhbGtpbmcgZ2VudGx5IHRvIGl0Lg==" },
  1690.           { "They say that you can train a dog by talking firmly to it.", 
  1691.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuIHRyYWluIGEgZG9nIGJ5IHRhbGtpbmcgZmlybWx5IHRvIGl0Lg==" },
  1692.           { "They say that you can trust your gold with the king.", 
  1693.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuIHRydXN0IHlvdXIgZ29sZCB3aXRoIHRoZSBraW5nLg==" },
  1694.           { "They say that you can't wipe your greasy bare hands on a blank scroll.", 
  1695.             "VGhleSBzYXkgdGhhdCB5b3UgY2FuJ3Qgd2lwZSB5b3VyIGdyZWFzeSBiYXJlIGhhbmRzIG9uIGEgYmxhbmsgc2Nyb2xsLg==" },
  1696.           { "They say that you cannot trust scrolls of rumor.", 
  1697.             "VGhleSBzYXkgdGhhdCB5b3UgY2Fubm90IHRydXN0IHNjcm9sbHMgb2YgcnVtb3Iu" },
  1698.           { "They say that you could fall head over heels for an energy vortex.", 
  1699.             "VGhleSBzYXkgdGhhdCB5b3UgY291bGQgZmFsbCBoZWFkIG92ZXIgaGVlbHMgZm9yIGFuIGVuZXJneSB2b3J0ZXgu" },
  1700.           { "They say that you need a key in order to open locked doors.", 
  1701.             "VGhleSBzYXkgdGhhdCB5b3UgbmVlZCBhIGtleSBpbiBvcmRlciB0byBvcGVuIGxvY2tlZCBkb29ycy4=" },
  1702.           { "They say that you need a mirror to notice a mimic in an antique shop.", 
  1703.             "VGhleSBzYXkgdGhhdCB5b3UgbmVlZCBhIG1pcnJvciB0byBub3RpY2UgYSBtaW1pYyBpbiBhbiBhbnRpcXVlIHNob3Au" },
  1704.           { "They say that you really can use a pick-axe unless you really can't.", 
  1705.             "VGhleSBzYXkgdGhhdCB5b3UgcmVhbGx5IGNhbiB1c2UgYSBwaWNrLWF4ZSB1bmxlc3MgeW91IHJlYWxseSBjYW4ndC4=" },
  1706.           { "They say that you should always store your tools in the cellar.", 
  1707.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIGFsd2F5cyBzdG9yZSB5b3VyIHRvb2xzIGluIHRoZSBjZWxsYXIu" },
  1708.           { "They say that you should be careful while climbing the ladder to success.", 
  1709.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIGJlIGNhcmVmdWwgd2hpbGUgY2xpbWJpbmcgdGhlIGxhZGRlciB0byBzdWNjZXNzLg==" },
  1710.           { "They say that you should call your armor `rustproof'.", 
  1711.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIGNhbGwgeW91ciBhcm1vciBgcnVzdHByb29mJy4=" },
  1712.           { "They say that you should name your dog Spuds to have a cool pet.", 
  1713.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIG5hbWUgeW91ciBkb2cgU3B1ZHMgdG8gaGF2ZSBhIGNvb2wgcGV0Lg==" },
  1714.           { "They say that you should name your weapon after your first monster kill.", 
  1715.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIG5hbWUgeW91ciB3ZWFwb24gYWZ0ZXIgeW91ciBmaXJzdCBtb25zdGVyIGtpbGwu" },
  1716.           { "They say that you should never introduce a rope golem to a succubus.", 
  1717.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIG5ldmVyIGludHJvZHVjZSBhIHJvcGUgZ29sZW0gdG8gYSBzdWNjdWJ1cy4=" },
  1718.           { "They say that you should never sleep near invisible ring wraiths.", 
  1719.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIG5ldmVyIHNsZWVwIG5lYXIgaW52aXNpYmxlIHJpbmcgd3JhaXRocy4=" },
  1720.           { "They say that you should never try to leave the dungeon with a bag of gems.", 
  1721.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIG5ldmVyIHRyeSB0byBsZWF2ZSB0aGUgZHVuZ2VvbiB3aXRoIGEgYmFnIG9mIGdlbXMu" },
  1722.           { "They say that you should remove your armor before sitting on a throne.", 
  1723.             "VGhleSBzYXkgdGhhdCB5b3Ugc2hvdWxkIHJlbW92ZSB5b3VyIGFybW9yIGJlZm9yZSBzaXR0aW5nIG9uIGEgdGhyb25lLg==" },
  1724.           { "This fortune cookie is copy protected.", 
  1725.             "VGhpcyBmb3J0dW5lIGNvb2tpZSBpcyBjb3B5IHByb3RlY3RlZC4=" },
  1726.           { "This fortune cookie is the property of Fortune Cookies, Inc.", 
  1727.             "VGhpcyBmb3J0dW5lIGNvb2tpZSBpcyB0aGUgcHJvcGVydHkgb2YgRm9ydHVuZSBDb29raWVzLCBJbmMu" },
  1728.           { "Tired? Try a scroll of charging on yourself.", 
  1729.             "VGlyZWQ/IFRyeSBhIHNjcm9sbCBvZiBjaGFyZ2luZyBvbiB5b3Vyc2VsZi4=" },
  1730.           { "To achieve the next higher rating, you need 3 more points.", 
  1731.             "VG8gYWNoaWV2ZSB0aGUgbmV4dCBoaWdoZXIgcmF0aW5nLCB5b3UgbmVlZCAzIG1vcmUgcG9pbnRzLg==" },
  1732.           { "To reach heaven, escape the dungeon while wearing a ring of levitation.", 
  1733.             "VG8gcmVhY2ggaGVhdmVuLCBlc2NhcGUgdGhlIGR1bmdlb24gd2hpbGUgd2VhcmluZyBhIHJpbmcgb2YgbGV2aXRhdGlvbi4=" },
  1734.           { "Tourists wear shirts loud enough to wake the dead.", 
  1735.             "VG91cmlzdHMgd2VhciBzaGlydHMgbG91ZCBlbm91Z2ggdG8gd2FrZSB0aGUgZGVhZC4=" },
  1736.           { "Try calling your katana Moulinette.", 
  1737.             "VHJ5IGNhbGxpbmcgeW91ciBrYXRhbmEgTW91bGluZXR0ZS4=" },
  1738.           { "Ulch! That meat was painted!", 
  1739.             "VWxjaCEgVGhhdCBtZWF0IHdhcyBwYWludGVkIQ==" },
  1740.           { "Unfortunately, this message was left intentionally blank.", 
  1741.             "VW5mb3J0dW5hdGVseSwgdGhpcyBtZXNzYWdlIHdhcyBsZWZ0IGludGVudGlvbmFsbHkgYmxhbmsu" },
  1742.           { "Using a morning star in the evening has no effect.", 
  1743.             "VXNpbmcgYSBtb3JuaW5nIHN0YXIgaW4gdGhlIGV2ZW5pbmcgaGFzIG5vIGVmZmVjdC4=" },
  1744.           { "Want a hint? Zap a wand of make invisible on your weapon!", 
  1745.             "V2FudCBhIGhpbnQ/IFphcCBhIHdhbmQgb2YgbWFrZSBpbnZpc2libGUgb24geW91ciB3ZWFwb24h" },
  1746.           { "Want to ascend in a hurry? Apply at Gizmonic Institute.", 
  1747.             "V2FudCB0byBhc2NlbmQgaW4gYSBodXJyeT8gQXBwbHkgYXQgR2l6bW9uaWMgSW5zdGl0dXRlLg==" },
  1748.           { "Wanted: shopkeepers. Send a scroll of mail to Mage of Yendor/Level 35/Dungeon.", 
  1749.             "V2FudGVkOiBzaG9wa2VlcGVycy4gU2VuZCBhIHNjcm9sbCBvZiBtYWlsIHRvIE1hZ2Ugb2YgWWVuZG9yL0xldmVsIDM1L0R1bmdlb24u" },
  1750.           { "Warning: fortune reading can be hazardous to your health.", 
  1751.             "V2FybmluZzogZm9ydHVuZSByZWFkaW5nIGNhbiBiZSBoYXphcmRvdXMgdG8geW91ciBoZWFsdGgu" },
  1752.           { "We have new ways of detecting treachery...", 
  1753.             "V2UgaGF2ZSBuZXcgd2F5cyBvZiBkZXRlY3RpbmcgdHJlYWNoZXJ5Li4u" },
  1754.           { "Wet towels make great weapons!", 
  1755.             "V2V0IHRvd2VscyBtYWtlIGdyZWF0IHdlYXBvbnMh" },
  1756.           { "What a pity, you cannot read it!", 
  1757.             "V2hhdCBhIHBpdHksIHlvdSBjYW5ub3QgcmVhZCBpdCE=" },
  1758.           { "When a piercer drops in on you, you will be tempted to hit the ceiling!", 
  1759.             "V2hlbiBhIHBpZXJjZXIgZHJvcHMgaW4gb24geW91LCB5b3Ugd2lsbCBiZSB0ZW1wdGVkIHRvIGhpdCB0aGUgY2VpbGluZyE=" },
  1760.           { "When in a maze follow the right wall and you will never get lost.", 
  1761.             "V2hlbiBpbiBhIG1hemUgZm9sbG93IHRoZSByaWdodCB3YWxsIGFuZCB5b3Ugd2lsbCBuZXZlciBnZXQgbG9zdC4=" },
  1762.           { "When you have a key, you don't have to wait for the guard.", 
  1763.             "V2hlbiB5b3UgaGF2ZSBhIGtleSwgeW91IGRvbid0IGhhdmUgdG8gd2FpdCBmb3IgdGhlIGd1YXJkLg==" },
  1764.           { "Why are you wasting time reading fortunes?", 
  1765.             "V2h5IGFyZSB5b3Ugd2FzdGluZyB0aW1lIHJlYWRpbmcgZm9ydHVuZXM/" },
  1766.           { "Wish for a master key and open the Magic Memory Vault!", 
  1767.             "V2lzaCBmb3IgYSBtYXN0ZXIga2V5IGFuZCBvcGVuIHRoZSBNYWdpYyBNZW1vcnkgVmF1bHQh" },
  1768.           { "Wizard expects every monster to do its duty.", 
  1769.             "V2l6YXJkIGV4cGVjdHMgZXZlcnkgbW9uc3RlciB0byBkbyBpdHMgZHV0eS4=" },
  1770.           { "Wow! You could've had a potion of fruit juice!", 
  1771.             "V293ISBZb3UgY291bGQndmUgaGFkIGEgcG90aW9uIG9mIGZydWl0IGp1aWNlIQ==" },
  1772.           { "Yet Another Silly Message (YASM).", 
  1773.             "WWV0IEFub3RoZXIgU2lsbHkgTWVzc2FnZSAoWUFTTSku" },
  1774.           { "You are destined to be misled by a fortune.", 
  1775.             "WW91IGFyZSBkZXN0aW5lZCB0byBiZSBtaXNsZWQgYnkgYSBmb3J0dW5lLg==" },
  1776.           { "You can get a genuine Amulet of Yendor by doing the following: --More--", 
  1777.             "WW91IGNhbiBnZXQgYSBnZW51aW5lIEFtdWxldCBvZiBZZW5kb3IgYnkgZG9pbmcgdGhlIGZvbGxvd2luZzogLS1Nb3JlLS0=" },
  1778.           { "You can protect yourself from black dragons by doing the following: --More--", 
  1779.             "WW91IGNhbiBwcm90ZWN0IHlvdXJzZWxmIGZyb20gYmxhY2sgZHJhZ29ucyBieSBkb2luZyB0aGUgZm9sbG93aW5nOiAtLU1vcmUtLQ==" },
  1780.           { "You can't get by the snake.", 
  1781.             "WW91IGNhbid0IGdldCBieSB0aGUgc25ha2Uu" },
  1782.           { "You feel like someone is pulling your leg.", 
  1783.             "WW91IGZlZWwgbGlrZSBzb21lb25lIGlzIHB1bGxpbmcgeW91ciBsZWcu" },
  1784.           { "You have to outwit the Sphynx or pay her.", 
  1785.             "WW91IGhhdmUgdG8gb3V0d2l0IHRoZSBTcGh5bnggb3IgcGF5IGhlci4=" },
  1786.           { "You hear the fortune cookie's hissing!", 
  1787.             "WW91IGhlYXIgdGhlIGZvcnR1bmUgY29va2llJ3MgaGlzc2luZyE=" },
  1788.           { "You may get rich selling letters, but beware of being blackmailed!", 
  1789.             "WW91IG1heSBnZXQgcmljaCBzZWxsaW5nIGxldHRlcnMsIGJ1dCBiZXdhcmUgb2YgYmVpbmcgYmxhY2ttYWlsZWQh" },
  1790.           { "You offend Shai-Hulud by sheathing your crysknife without having drawn blood.", 
  1791.             "WW91IG9mZmVuZCBTaGFpLUh1bHVkIGJ5IHNoZWF0aGluZyB5b3VyIGNyeXNrbmlmZSB3aXRob3V0IGhhdmluZyBkcmF3biBibG9vZC4=" },
  1792.           { "You swallowed the fortune!", 
  1793.             "WW91IHN3YWxsb3dlZCB0aGUgZm9ydHVuZSE=" },
  1794.           { "You want to regain strength? Two levels ahead is a guesthouse!", 
  1795.             "WW91IHdhbnQgdG8gcmVnYWluIHN0cmVuZ3RoPyBUd28gbGV2ZWxzIGFoZWFkIGlzIGEgZ3Vlc3Rob3VzZSE=" },
  1796.           { "You will encounter a tall, dark, and gruesome creature...", 
  1797.             "WW91IHdpbGwgZW5jb3VudGVyIGEgdGFsbCwgZGFyaywgYW5kIGdydWVzb21lIGNyZWF0dXJlLi4u" },
  1798.  
  1799.           { "The End", "VGhlIEVuZA==" }
  1800.       };
  1801.  
  1802. /* PL_Base64Encode, random strings */
  1803. PRBool test_004(void)
  1804. {
  1805.     int i;
  1806.     char result[ 4096 ];
  1807.  
  1808.     printf("Test 004 (PL_Base64Encode, random strings)                            ..."); fflush(stdout);
  1809.  
  1810.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  1811.     {
  1812.         PRUint32 plen = PL_strlen(array[i].plaintext);
  1813.         PRUint32 clen = ((plen + 2)/3)*4;
  1814.  
  1815.         char *rv = PL_Base64Encode(array[i].plaintext, plen, result);
  1816.  
  1817.         if( rv != result )
  1818.         {
  1819.             printf("FAIL\n\t(%d): return value\n", i);
  1820.             return PR_FALSE;
  1821.         }
  1822.  
  1823.         if( 0 != PL_strncmp(result, array[i].cyphertext, clen) )
  1824.         {
  1825.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%.*s.\"\n", 
  1826.                    i, array[i].plaintext, array[i].cyphertext, clen, result);
  1827.             return PR_FALSE;
  1828.         }
  1829.     }
  1830.  
  1831.     printf("PASS\n");
  1832.     return PR_TRUE;
  1833. }
  1834.  
  1835. /* PL_Base64Encode, single characters, malloc */
  1836. PRBool test_005(void)
  1837. {
  1838.     PRUint32 a, b;
  1839.     unsigned char plain[ 4 ];
  1840.     unsigned char cypher[ 5 ];
  1841.     char *rv;
  1842.  
  1843.     printf("Test 005 (PL_Base64Encode, single characters, malloc)                 ..."); fflush(stdout);
  1844.  
  1845.     plain[1] = plain[2] = plain[3] = (unsigned char)0;
  1846.     cypher[2] = cypher[3] = (unsigned char)'=';
  1847.     cypher[4] = (unsigned char)0;
  1848.  
  1849.     for( a = 0; a < 64; a++ )
  1850.     {
  1851.         cypher[0] = base[a];
  1852.  
  1853.         for( b = 0; b < 4; b++ )
  1854.         {
  1855.             plain[0] = (unsigned char)(a * 4 + b);
  1856.             cypher[1] = base[(b * 16)];
  1857.  
  1858.             rv = PL_Base64Encode((char *)plain, 1, (char *)0);
  1859.             if( (char *)0 == rv )
  1860.             {
  1861.                 printf("FAIL\n\t(%d, %d): no return value\n", a, b);
  1862.                 return PR_FALSE;
  1863.             }
  1864.  
  1865.             if( 0 != PL_strcmp((char *)cypher, rv) )
  1866.             {
  1867.                 printf("FAIL\n\t(%d, %d): expected \"%s,\" got \"%s.\"\n",
  1868.                        a, b, cypher, rv);
  1869.                 PR_DELETE(rv);
  1870.                 return PR_FALSE;
  1871.             }
  1872.  
  1873.             PR_DELETE(rv);
  1874.         }
  1875.     }
  1876.  
  1877.     printf("PASS\n");
  1878.     return PR_TRUE;
  1879. }
  1880.  
  1881. /* PL_Base64Encode, double characters, malloc */
  1882. PRBool test_006(void)
  1883. {
  1884.     PRUint32 a, b, c, d;
  1885.     unsigned char plain[ 4 ];
  1886.     unsigned char cypher[ 5 ];
  1887.     char *rv;
  1888.  
  1889.     printf("Test 006 (PL_Base64Encode, double characters, malloc)                 ..."); fflush(stdout);
  1890.  
  1891.     plain[2] = plain[3] = (unsigned char)0;
  1892.     cypher[3] = (unsigned char)'=';
  1893.     cypher[4] = (unsigned char)0;
  1894.  
  1895.     for( a = 0; a < 64; a++ )
  1896.     {
  1897.         cypher[0] = base[a];
  1898.         for( b = 0; b < 4; b++ )
  1899.         {
  1900.             plain[0] = (a*4) + b;
  1901.             for( c = 0; c < 16; c++ )
  1902.             {
  1903.                 cypher[1] = base[b*16 + c];
  1904.                 for( d = 0; d < 16; d++ )
  1905.                 {
  1906.                     plain[1] = c*16 + d;
  1907.                     cypher[2] = base[d*4];
  1908.  
  1909.                     rv = PL_Base64Encode((char *)plain, 2, (char *)0);
  1910.                     if( (char *)0 == rv )
  1911.                     {
  1912.                         printf("FAIL\n\t(%d, %d, %d, %d): no return value\n", a, b, c, d);
  1913.                         return PR_FALSE;
  1914.                     }
  1915.  
  1916.                     if( 0 != PL_strcmp((char *)cypher, rv) )
  1917.                     {
  1918.                         printf("FAIL\n\t(%d, %d, %d, %d): expected \"%s,\" got \"%s.\"\n",
  1919.                                a, b, c, d, cypher, rv);
  1920.                         PR_DELETE(rv);
  1921.                         return PR_FALSE;
  1922.                     }
  1923.  
  1924.                     PR_DELETE(rv);
  1925.                 }
  1926.             }
  1927.         }
  1928.     }
  1929.  
  1930.     printf("PASS\n");
  1931.     return PR_TRUE;
  1932. }
  1933.  
  1934. /* PL_Base64Encode, triple characters, malloc */
  1935. PRBool test_007(void)
  1936. {
  1937.     PRUint32 a, b, c, d, e, f;
  1938.     unsigned char plain[ 4 ];
  1939.     unsigned char cypher[ 5 ];
  1940.     char *rv;
  1941.  
  1942.     printf("Test 007 (PL_Base64Encode, triple characters, malloc)                 ..."); fflush(stdout);
  1943.  
  1944.     cypher[4] = (unsigned char)0;
  1945.  
  1946.     for( a = 0; a < 64; a++ )
  1947.     {
  1948.         cypher[0] = base[a];
  1949.         for( b = 0; b < 4; b++ )
  1950.         {
  1951.             plain[0] = (a*4) + b;
  1952.             for( c = 0; c < 16; c++ )
  1953.             {
  1954.                 cypher[1] = base[b*16 + c];
  1955.                 for( d = 0; d < 16; d++ )
  1956.                 {
  1957.                     plain[1] = c*16 + d;
  1958.                     for( e = 0; e < 4; e++ )
  1959.                     {
  1960.                         cypher[2] = base[d*4 + e];
  1961.                         for( f = 0; f < 64; f++ )
  1962.                         {
  1963.                             plain[2] = e * 64 + f;
  1964.                             cypher[3] = base[f];
  1965.  
  1966.                             rv = PL_Base64Encode((char *)plain, 3, (char *)0);
  1967.                             if( (char *)0 == rv )
  1968.                             {
  1969.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): no return value\n", a, b, c, d, e, f);
  1970.                                 return PR_FALSE;
  1971.                             }
  1972.  
  1973.                             if( 0 != PL_strcmp((char *)cypher, rv) )
  1974.                             {
  1975.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): expected \"%s,\" got \"%.4s.\"\n",
  1976.                                        a, b, c, d, e, f, cypher, rv);
  1977.                                 PR_DELETE(rv);
  1978.                                 return PR_FALSE;
  1979.                             }
  1980.  
  1981.                             PR_DELETE(rv);
  1982.                         }
  1983.                     }
  1984.                 }
  1985.             }
  1986.         }
  1987.     }
  1988.  
  1989.     printf("PASS\n");
  1990.     return PR_TRUE;
  1991. }
  1992.  
  1993. /* PL_Base64Encode, random strings, malloc */
  1994. PRBool test_008(void)
  1995. {
  1996.     int i;
  1997.  
  1998.     printf("Test 008 (PL_Base64Encode, random strings, malloc)                    ..."); fflush(stdout);
  1999.  
  2000.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2001.     {
  2002.         PRUint32 plen = PL_strlen(array[i].plaintext);
  2003.         PRUint32 clen = ((plen + 2)/3)*4;
  2004.  
  2005.         char *rv = PL_Base64Encode(array[i].plaintext, plen, (char *)0);
  2006.  
  2007.         if( (char *)0 == rv )
  2008.         {
  2009.             printf("FAIL\n\t(%d): no return value\n", i);
  2010.             return PR_FALSE;
  2011.         }
  2012.  
  2013.         if( 0 != PL_strcmp(rv, array[i].cyphertext) )
  2014.         {
  2015.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%s.\"\n", 
  2016.                    i, array[i].plaintext, array[i].cyphertext, rv);
  2017.             return PR_FALSE;
  2018.         }
  2019.     }
  2020.  
  2021.     printf("PASS\n");
  2022.     return PR_TRUE;
  2023. }
  2024.  
  2025. /* PL_Base64Decode, single characters */
  2026. PRBool test_009(void)
  2027. {
  2028.     PRUint32 a, b;
  2029.     unsigned char plain[ 4 ];
  2030.     unsigned char cypher[ 5 ];
  2031.     char result[ 8 ];
  2032.     char *rv;
  2033.  
  2034.     printf("Test 009 (PL_Base64Decode, single characters, equals)                 ..."); fflush(stdout);
  2035.  
  2036.     plain[1] = plain[2] = plain[3] = (unsigned char)0;
  2037.     cypher[2] = cypher[3] = (unsigned char)'=';
  2038.     cypher[4] = (unsigned char)0;
  2039.  
  2040.     for( a = 0; a < 64; a++ )
  2041.     {
  2042.         cypher[0] = base[a];
  2043.  
  2044.         for( b = 0; b < 4; b++ )
  2045.         {
  2046.             plain[0] = (unsigned char)(a * 4 + b);
  2047.             cypher[1] = base[(b * 16)];
  2048.  
  2049.             rv = PL_Base64Decode((char *)cypher, 4, result);
  2050.             if( rv != result )
  2051.             {
  2052.                 printf("FAIL\n\t(%d, %d): return value\n", a, b);
  2053.                 return PR_FALSE;
  2054.             }
  2055.  
  2056.             if( 0 != PL_strncmp((char *)plain, result, 1) )
  2057.             {
  2058.                 printf("FAIL\n\t(%d, %d): expected \"%s,\" got \"%.1s.\"\n",
  2059.                        a, b, plain, result);
  2060.                 return PR_FALSE;
  2061.             }
  2062.         }
  2063.     }
  2064.  
  2065.     printf("PASS\n");
  2066.     return PR_TRUE;
  2067. }
  2068.  
  2069. /* PL_Base64Decode, single characters */
  2070. PRBool test_010(void)
  2071. {
  2072.     PRUint32 a, b;
  2073.     unsigned char plain[ 4 ];
  2074.     unsigned char cypher[ 5 ];
  2075.     char result[ 8 ];
  2076.     char *rv;
  2077.  
  2078.     printf("Test 010 (PL_Base64Decode, single characters, no equals)              ..."); fflush(stdout);
  2079.  
  2080.     plain[1] = plain[2] = plain[3] = (unsigned char)0;
  2081.     cypher[2] = cypher[3] = (unsigned char)0;
  2082.     cypher[4] = (unsigned char)0;
  2083.  
  2084.     for( a = 0; a < 64; a++ )
  2085.     {
  2086.         cypher[0] = base[a];
  2087.  
  2088.         for( b = 0; b < 4; b++ )
  2089.         {
  2090.             plain[0] = (unsigned char)(a * 4 + b);
  2091.             cypher[1] = base[(b * 16)];
  2092.  
  2093.             rv = PL_Base64Decode((char *)cypher, 2, result);
  2094.             if( rv != result )
  2095.             {
  2096.                 printf("FAIL\n\t(%d, %d): return value\n", a, b);
  2097.                 return PR_FALSE;
  2098.             }
  2099.  
  2100.             if( 0 != PL_strncmp((char *)plain, result, 1) )
  2101.             {
  2102.                 printf("FAIL\n\t(%d, %d): expected \"%s,\" got \"%.1s.\"\n",
  2103.                        a, b, plain, result);
  2104.                 return PR_FALSE;
  2105.             }
  2106.         }
  2107.     }
  2108.  
  2109.     printf("PASS\n");
  2110.     return PR_TRUE;
  2111. }
  2112.  
  2113. /* PL_Base64Decode, double characters */
  2114. PRBool test_011(void)
  2115. {
  2116.     PRUint32 a, b, c, d;
  2117.     unsigned char plain[ 4 ];
  2118.     unsigned char cypher[ 5 ];
  2119.     char result[ 8 ];
  2120.     char *rv;
  2121.  
  2122.     printf("Test 011 (PL_Base64Decode, double characters, equals)                 ..."); fflush(stdout);
  2123.  
  2124.     plain[2] = plain[3] = (unsigned char)0;
  2125.     cypher[3] = (unsigned char)'=';
  2126.     cypher[4] = (unsigned char)0;
  2127.  
  2128.     for( a = 0; a < 64; a++ )
  2129.     {
  2130.         cypher[0] = base[a];
  2131.         for( b = 0; b < 4; b++ )
  2132.         {
  2133.             plain[0] = (a*4) + b;
  2134.             for( c = 0; c < 16; c++ )
  2135.             {
  2136.                 cypher[1] = base[b*16 + c];
  2137.                 for( d = 0; d < 16; d++ )
  2138.                 {
  2139.                     plain[1] = c*16 + d;
  2140.                     cypher[2] = base[d*4];
  2141.  
  2142.                     rv = PL_Base64Decode((char *)cypher, 4, result);
  2143.                     if( rv != result )
  2144.                     {
  2145.                         printf("FAIL\n\t(%d, %d, %d, %d): return value\n", a, b, c, d);
  2146.                         return PR_FALSE;
  2147.                     }
  2148.  
  2149.                     if( 0 != PL_strncmp((char *)plain, result, 2) )
  2150.                     {
  2151.                         printf("FAIL\n\t(%d, %d, %d, %d): expected \"%s,\" got \"%.2s.\"\n",
  2152.                                a, b, c, d, plain, result);
  2153.                         return PR_FALSE;
  2154.                     }
  2155.                 }
  2156.             }
  2157.         }
  2158.     }
  2159.  
  2160.     printf("PASS\n");
  2161.     return PR_TRUE;
  2162. }
  2163.  
  2164. /* PL_Base64Decode, double characters */
  2165. PRBool test_012(void)
  2166. {
  2167.     PRUint32 a, b, c, d;
  2168.     unsigned char plain[ 4 ];
  2169.     unsigned char cypher[ 5 ];
  2170.     char result[ 8 ];
  2171.     char *rv;
  2172.  
  2173.     printf("Test 012 (PL_Base64Decode, double characters, no equals)              ..."); fflush(stdout);
  2174.  
  2175.     plain[2] = plain[3] = (unsigned char)0;
  2176.     cypher[3] = (unsigned char)0;
  2177.     cypher[4] = (unsigned char)0;
  2178.  
  2179.     for( a = 0; a < 64; a++ )
  2180.     {
  2181.         cypher[0] = base[a];
  2182.         for( b = 0; b < 4; b++ )
  2183.         {
  2184.             plain[0] = (a*4) + b;
  2185.             for( c = 0; c < 16; c++ )
  2186.             {
  2187.                 cypher[1] = base[b*16 + c];
  2188.                 for( d = 0; d < 16; d++ )
  2189.                 {
  2190.                     plain[1] = c*16 + d;
  2191.                     cypher[2] = base[d*4];
  2192.  
  2193.                     rv = PL_Base64Decode((char *)cypher, 3, result);
  2194.                     if( rv != result )
  2195.                     {
  2196.                         printf("FAIL\n\t(%d, %d, %d, %d): return value\n", a, b, c, d);
  2197.                         return PR_FALSE;
  2198.                     }
  2199.  
  2200.                     if( 0 != PL_strncmp((char *)plain, result, 2) )
  2201.                     {
  2202.                         printf("FAIL\n\t(%d, %d, %d, %d): expected \"%s,\" got \"%.2s.\"\n",
  2203.                                a, b, c, d, cypher, result);
  2204.                         return PR_FALSE;
  2205.                     }
  2206.                 }
  2207.             }
  2208.         }
  2209.     }
  2210.  
  2211.     printf("PASS\n");
  2212.     return PR_TRUE;
  2213. }
  2214.  
  2215. /* PL_Base64Decode, triple characters */
  2216. PRBool test_013(void)
  2217. {
  2218.     PRUint32 a, b, c, d, e, f;
  2219.     unsigned char plain[ 4 ];
  2220.     unsigned char cypher[ 5 ];
  2221.     char result[ 8 ];
  2222.     char *rv;
  2223.  
  2224.     printf("Test 013 (PL_Base64Decode, triple characters)                         ..."); fflush(stdout);
  2225.  
  2226.     cypher[4] = (unsigned char)0;
  2227.  
  2228.     for( a = 0; a < 64; a++ )
  2229.     {
  2230.         cypher[0] = base[a];
  2231.         for( b = 0; b < 4; b++ )
  2232.         {
  2233.             plain[0] = (a*4) + b;
  2234.             for( c = 0; c < 16; c++ )
  2235.             {
  2236.                 cypher[1] = base[b*16 + c];
  2237.                 for( d = 0; d < 16; d++ )
  2238.                 {
  2239.                     plain[1] = c*16 + d;
  2240.                     for( e = 0; e < 4; e++ )
  2241.                     {
  2242.                         cypher[2] = base[d*4 + e];
  2243.                         for( f = 0; f < 64; f++ )
  2244.                         {
  2245.                             plain[2] = e * 64 + f;
  2246.                             cypher[3] = base[f];
  2247.  
  2248.                             rv = PL_Base64Decode((char *)cypher, 4, result);
  2249.                             if( rv != result )
  2250.                             {
  2251.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): return value\n", a, b, c, d, e, f);
  2252.                                 return PR_FALSE;
  2253.                             }
  2254.  
  2255.                             if( 0 != PL_strncmp((char *)plain, result, 3) )
  2256.                             {
  2257.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): expected \"%s,\" got \"%.3s.\"\n",
  2258.                                        a, b, c, d, e, f, plain, result);
  2259.                                 return PR_FALSE;
  2260.                             }
  2261.                         }
  2262.                     }
  2263.                 }
  2264.             }
  2265.         }
  2266.     }
  2267.  
  2268.     printf("PASS\n");
  2269.     return PR_TRUE;
  2270. }
  2271.  
  2272. /* PL_Base64Decode, random strings */
  2273. PRBool test_014(void)
  2274. {
  2275.     int i;
  2276.     char result[ 4096 ];
  2277.  
  2278.     printf("Test 014 (PL_Base64Decode, random strings, equals)                    ..."); fflush(stdout);
  2279.  
  2280.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2281.     {
  2282.         PRUint32 clen = PL_strlen(array[i].cyphertext);
  2283.         PRUint32 plen = (clen * 3) / 4;
  2284.  
  2285.         char *rv = PL_Base64Decode(array[i].cyphertext, clen, result);
  2286.  
  2287.         if( rv != result )
  2288.         {
  2289.             printf("FAIL\n\t(%d): return value\n", i);
  2290.             return PR_FALSE;
  2291.         }
  2292.  
  2293.         if( 0 == (clen & 3) )
  2294.         {
  2295.             if( '=' == array[i].cyphertext[clen-1] )
  2296.             {
  2297.                 if( '=' == array[i].cyphertext[clen-2] )
  2298.                 {
  2299.                     plen -= 2;
  2300.                 }
  2301.                 else
  2302.                 {
  2303.                     plen -= 1;
  2304.                 }
  2305.             }
  2306.         }
  2307.  
  2308.         if( 0 != PL_strncmp(result, array[i].plaintext, plen) )
  2309.         {
  2310.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%.*s.\"\n", 
  2311.                    i, array[i].cyphertext, array[i].plaintext, plen, result);
  2312.             return PR_FALSE;
  2313.         }
  2314.     }
  2315.  
  2316.     printf("PASS\n");
  2317.     return PR_TRUE;
  2318. }
  2319.  
  2320. /* PL_Base64Decode, random strings */
  2321. PRBool test_015(void)
  2322. {
  2323.     int i;
  2324.     char buffer[ 4096 ];
  2325.     char result[ 4096 ];
  2326.     char *rv;
  2327.  
  2328.     printf("Test 015 (PL_Base64Decode, random strings, no equals)                 ..."); fflush(stdout);
  2329.  
  2330.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2331.     {
  2332.         PRUint32 clen, plen;
  2333.  
  2334.         PL_strcpy(buffer, array[i].cyphertext);
  2335.         clen = PL_strlen(buffer);
  2336.  
  2337.         if( 0 == (clen & 3) )
  2338.         {
  2339.             if( '=' == buffer[clen-1] )
  2340.             {
  2341.                 if( '=' == buffer[clen-2] )
  2342.                 {
  2343.                     buffer[clen-2] = buffer[clen-1] = (char)0;
  2344.                     clen -= 2;
  2345.                 }
  2346.                 else
  2347.                 {
  2348.                     buffer[clen-1] = (char)0;
  2349.                     clen -= 1;
  2350.                 }
  2351.             }
  2352.         }
  2353.  
  2354.         plen = (clen * 3) / 4;
  2355.  
  2356.         rv = PL_Base64Decode(buffer, clen, result);
  2357.  
  2358.         if( rv != result )
  2359.         {
  2360.             printf("FAIL\n\t(%d): return value\n", i);
  2361.             return PR_FALSE;
  2362.         }
  2363.  
  2364.         if( 0 != PL_strncmp(result, array[i].plaintext, plen) )
  2365.         {
  2366.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%.*s.\"\n", 
  2367.                    i, array[i].cyphertext, array[i].plaintext, plen, result);
  2368.             return PR_FALSE;
  2369.         }
  2370.     }
  2371.  
  2372.     printf("PASS\n");
  2373.     return PR_TRUE;
  2374. }
  2375.  
  2376. /* PL_Base64Decode, single characters, malloc */
  2377. PRBool test_016(void)
  2378. {
  2379.     PRUint32 a, b;
  2380.     unsigned char plain[ 4 ];
  2381.     unsigned char cypher[ 5 ];
  2382.     char *rv;
  2383.  
  2384.     printf("Test 016 (PL_Base64Decode, single characters, equals, malloc)         ..."); fflush(stdout);
  2385.  
  2386.     plain[1] = plain[2] = plain[3] = (unsigned char)0;
  2387.     cypher[2] = cypher[3] = (unsigned char)'=';
  2388.     cypher[4] = (unsigned char)0;
  2389.  
  2390.     for( a = 0; a < 64; a++ )
  2391.     {
  2392.         cypher[0] = base[a];
  2393.  
  2394.         for( b = 0; b < 4; b++ )
  2395.         {
  2396.             plain[0] = (unsigned char)(a * 4 + b);
  2397.             cypher[1] = base[(b * 16)];
  2398.  
  2399.             rv = PL_Base64Decode((char *)cypher, 4, (char *)0);
  2400.             if( (char *)0 == rv )
  2401.             {
  2402.                 printf("FAIL\n\t(%d, %d): no return value\n", a, b);
  2403.                 return PR_FALSE;
  2404.             }
  2405.  
  2406.             if( 0 != PL_strcmp((char *)plain, rv) )
  2407.             {
  2408.                 printf("FAIL\n\t(%d, %d): expected \"%s,\" got \"%s.\"\n",
  2409.                        a, b, plain, rv);
  2410.                 PR_DELETE(rv);
  2411.                 return PR_FALSE;
  2412.             }
  2413.  
  2414.             PR_DELETE(rv);
  2415.         }
  2416.     }
  2417.  
  2418.     printf("PASS\n");
  2419.     return PR_TRUE;
  2420. }
  2421.  
  2422. /* PL_Base64Decode, single characters, malloc */
  2423. PRBool test_017(void)
  2424. {
  2425.     PRUint32 a, b;
  2426.     unsigned char plain[ 4 ];
  2427.     unsigned char cypher[ 5 ];
  2428.     char *rv;
  2429.  
  2430.     printf("Test 017 (PL_Base64Decode, single characters, no equals, malloc)      ..."); fflush(stdout);
  2431.  
  2432.     plain[1] = plain[2] = plain[3] = (unsigned char)0;
  2433.     cypher[2] = cypher[3] = (unsigned char)0;
  2434.     cypher[4] = (unsigned char)0;
  2435.  
  2436.     for( a = 0; a < 64; a++ )
  2437.     {
  2438.         cypher[0] = base[a];
  2439.  
  2440.         for( b = 0; b < 4; b++ )
  2441.         {
  2442.             plain[0] = (unsigned char)(a * 4 + b);
  2443.             cypher[1] = base[(b * 16)];
  2444.  
  2445.             rv = PL_Base64Decode((char *)cypher, 2, (char *)0);
  2446.             if( (char *)0 == rv )
  2447.             {
  2448.                 printf("FAIL\n\t(%d, %d): no return value\n", a, b);
  2449.                 return PR_FALSE;
  2450.             }
  2451.  
  2452.             if( 0 != PL_strcmp((char *)plain, rv) )
  2453.             {
  2454.                 printf("FAIL\n\t(%d, %d): expected \"%s,\" got \"%s.\"\n",
  2455.                        a, b, plain, rv);
  2456.                 PR_DELETE(rv);
  2457.                 return PR_FALSE;
  2458.             }
  2459.  
  2460.             PR_DELETE(rv);
  2461.         }
  2462.     }
  2463.  
  2464.     printf("PASS\n");
  2465.     return PR_TRUE;
  2466. }
  2467.  
  2468. /* PL_Base64Decode, double characters, malloc */
  2469. PRBool test_018(void)
  2470. {
  2471.     PRUint32 a, b, c, d;
  2472.     unsigned char plain[ 4 ];
  2473.     unsigned char cypher[ 5 ];
  2474.     char *rv;
  2475.  
  2476.     printf("Test 018 (PL_Base64Decode, double characters, equals, malloc)         ..."); fflush(stdout);
  2477.  
  2478.     plain[2] = plain[3] = (unsigned char)0;
  2479.     cypher[3] = (unsigned char)'=';
  2480.     cypher[4] = (unsigned char)0;
  2481.  
  2482.     for( a = 0; a < 64; a++ )
  2483.     {
  2484.         cypher[0] = base[a];
  2485.         for( b = 0; b < 4; b++ )
  2486.         {
  2487.             plain[0] = (a*4) + b;
  2488.             for( c = 0; c < 16; c++ )
  2489.             {
  2490.                 cypher[1] = base[b*16 + c];
  2491.                 for( d = 0; d < 16; d++ )
  2492.                 {
  2493.                     plain[1] = c*16 + d;
  2494.                     cypher[2] = base[d*4];
  2495.  
  2496.                     rv = PL_Base64Decode((char *)cypher, 4, (char *)0);
  2497.                     if( (char *)0 == rv )
  2498.                     {
  2499.                         printf("FAIL\n\t(%d, %d, %d, %d): no return value\n", a, b, c, d);
  2500.                         return PR_FALSE;
  2501.                     }
  2502.  
  2503.                     if( 0 != PL_strcmp((char *)plain, rv) )
  2504.                     {
  2505.                         printf("FAIL\n\t(%d, %d, %d, %d): expected \"%s,\" got \"%s.\"\n",
  2506.                                a, b, c, d, plain, rv);
  2507.                         PR_DELETE(rv);
  2508.                         return PR_FALSE;
  2509.                     }
  2510.  
  2511.                     PR_DELETE(rv);
  2512.                 }
  2513.             }
  2514.         }
  2515.     }
  2516.  
  2517.     printf("PASS\n");
  2518.     return PR_TRUE;
  2519. }
  2520.  
  2521. /* PL_Base64Decode, double characters, malloc */
  2522. PRBool test_019(void)
  2523. {
  2524.     PRUint32 a, b, c, d;
  2525.     unsigned char plain[ 4 ];
  2526.     unsigned char cypher[ 5 ];
  2527.     char *rv;
  2528.  
  2529.     printf("Test 019 (PL_Base64Decode, double characters, no equals, malloc)      ..."); fflush(stdout);
  2530.  
  2531.     plain[2] = plain[3] = (unsigned char)0;
  2532.     cypher[3] = (unsigned char)0;
  2533.     cypher[4] = (unsigned char)0;
  2534.  
  2535.     for( a = 0; a < 64; a++ )
  2536.     {
  2537.         cypher[0] = base[a];
  2538.         for( b = 0; b < 4; b++ )
  2539.         {
  2540.             plain[0] = (a*4) + b;
  2541.             for( c = 0; c < 16; c++ )
  2542.             {
  2543.                 cypher[1] = base[b*16 + c];
  2544.                 for( d = 0; d < 16; d++ )
  2545.                 {
  2546.                     plain[1] = c*16 + d;
  2547.                     cypher[2] = base[d*4];
  2548.  
  2549.                     rv = PL_Base64Decode((char *)cypher, 3, (char *)0);
  2550.                     if( (char *)0 == rv )
  2551.                     {
  2552.                         printf("FAIL\n\t(%d, %d, %d, %d): no return value\n", a, b, c, d);
  2553.                         return PR_FALSE;
  2554.                     }
  2555.  
  2556.                     if( 0 != PL_strcmp((char *)plain, rv) )
  2557.                     {
  2558.                         printf("FAIL\n\t(%d, %d, %d, %d): expected \"%s,\" got \"%s.\"\n",
  2559.                                a, b, c, d, cypher, rv);
  2560.                         PR_DELETE(rv);
  2561.                         return PR_FALSE;
  2562.                     }
  2563.  
  2564.                     PR_DELETE(rv);
  2565.                 }
  2566.             }
  2567.         }
  2568.     }
  2569.  
  2570.     printf("PASS\n");
  2571.     return PR_TRUE;
  2572. }
  2573.  
  2574. /* PL_Base64Decode, triple characters, malloc */
  2575. PRBool test_020(void)
  2576. {
  2577.     PRUint32 a, b, c, d, e, f;
  2578.     unsigned char plain[ 4 ];
  2579.     unsigned char cypher[ 5 ];
  2580.     char *rv;
  2581.  
  2582.     printf("Test 020 (PL_Base64Decode, triple characters, malloc)                 ..."); fflush(stdout);
  2583.  
  2584.     cypher[4] = (unsigned char)0;
  2585.     plain[3] = (unsigned char)0;
  2586.  
  2587.     for( a = 0; a < 64; a++ )
  2588.     {
  2589.         cypher[0] = base[a];
  2590.         for( b = 0; b < 4; b++ )
  2591.         {
  2592.             plain[0] = (a*4) + b;
  2593.             for( c = 0; c < 16; c++ )
  2594.             {
  2595.                 cypher[1] = base[b*16 + c];
  2596.                 for( d = 0; d < 16; d++ )
  2597.                 {
  2598.                     plain[1] = c*16 + d;
  2599.                     for( e = 0; e < 4; e++ )
  2600.                     {
  2601.                         cypher[2] = base[d*4 + e];
  2602.                         for( f = 0; f < 64; f++ )
  2603.                         {
  2604.                             plain[2] = e * 64 + f;
  2605.                             cypher[3] = base[f];
  2606.  
  2607.                             rv = PL_Base64Decode((char *)cypher, 4, (char *)0);
  2608.                             if( (char *)0 == rv )
  2609.                             {
  2610.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): no return value\n", a, b, c, d, e, f);
  2611.                                 return PR_FALSE;
  2612.                             }
  2613.  
  2614.                             if( 0 != PL_strcmp((char *)plain, rv) )
  2615.                             {
  2616.                                 printf("FAIL\n\t(%d, %d, %d, %d, %d, %d): expected \"%s,\" got \"%.3s.\"\n",
  2617.                                        a, b, c, d, e, f, plain, rv);
  2618.                                 PR_DELETE(rv);
  2619.                                 return PR_FALSE;
  2620.                             }
  2621.  
  2622.                             PR_DELETE(rv);
  2623.                         }
  2624.                     }
  2625.                 }
  2626.             }
  2627.         }
  2628.     }
  2629.  
  2630.     printf("PASS\n");
  2631.     return PR_TRUE;
  2632. }
  2633.  
  2634. /* PL_Base64Decode, random strings, malloc */
  2635. PRBool test_021(void)
  2636. {
  2637.     int i;
  2638.  
  2639.     printf("Test 021 (PL_Base64Decode, random strings, equals, malloc)            ..."); fflush(stdout);
  2640.  
  2641.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2642.     {
  2643.         PRUint32 clen = PL_strlen(array[i].cyphertext);
  2644.  
  2645.         char *rv = PL_Base64Decode(array[i].cyphertext, clen, (char *)0);
  2646.  
  2647.         if( (char *)0 == rv )
  2648.         {
  2649.             printf("FAIL\n\t(%d): no return value\n", i);
  2650.             return PR_FALSE;
  2651.         }
  2652.  
  2653.         if( 0 != PL_strcmp(rv, array[i].plaintext) )
  2654.         {
  2655.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%s.\"\n", 
  2656.                    i, array[i].cyphertext, array[i].plaintext, rv);
  2657.             PR_DELETE(rv);
  2658.             return PR_FALSE;
  2659.         }
  2660.  
  2661.         PR_DELETE(rv);
  2662.     }
  2663.  
  2664.     printf("PASS\n");
  2665.     return PR_TRUE;
  2666. }
  2667.  
  2668. /* PL_Base64Encode, random strings, malloc */
  2669. PRBool test_022(void)
  2670. {
  2671.     int i;
  2672.     char buffer[ 4096 ];
  2673.     char *rv;
  2674.  
  2675.     printf("Test 022 (PL_Base64Decode, random strings, no equals, malloc)         ..."); fflush(stdout);
  2676.  
  2677.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2678.     {
  2679.         PRUint32 clen;
  2680.  
  2681.         PL_strcpy(buffer, array[i].cyphertext);
  2682.         clen = PL_strlen(buffer);
  2683.  
  2684.         if( 0 == (clen & 3) )
  2685.         {
  2686.             if( '=' == buffer[clen-1] )
  2687.             {
  2688.                 if( '=' == buffer[clen-2] )
  2689.                 {
  2690.                     buffer[clen-2] = buffer[clen-1] = (char)0;
  2691.                     clen -= 2;
  2692.                 }
  2693.                 else
  2694.                 {
  2695.                     buffer[clen-1] = (char)0;
  2696.                     clen -= 1;
  2697.                 }
  2698.             }
  2699.         }
  2700.  
  2701.         rv = PL_Base64Decode(buffer, clen, (char *)0);
  2702.  
  2703.         if( (char *)0 == rv )
  2704.         {
  2705.             printf("FAIL\n\t(%d): no return value\n", i);
  2706.             return PR_FALSE;
  2707.         }
  2708.  
  2709.         if( 0 != PL_strcmp(rv, array[i].plaintext) )
  2710.         {
  2711.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%s.\"\n", 
  2712.                    i, array[i].cyphertext, array[i].plaintext, rv);
  2713.             return PR_FALSE;
  2714.         }
  2715.     }
  2716.  
  2717.     printf("PASS\n");
  2718.     return PR_TRUE;
  2719. }
  2720.  
  2721. /* PL_Base64Encode, random strings */
  2722. PRBool test_023(void)
  2723. {
  2724.     int i;
  2725.     char result[ 4096 ];
  2726.  
  2727.     printf("Test 023 (PL_Base64Encode, random strings, strlen)                    ..."); fflush(stdout);
  2728.  
  2729.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2730.     {
  2731.         PRUint32 plen = PL_strlen(array[i].plaintext);
  2732.         PRUint32 clen = ((plen + 2)/3)*4;
  2733.  
  2734.         char *rv = PL_Base64Encode(array[i].plaintext, 0, result);
  2735.  
  2736.         if( rv != result )
  2737.         {
  2738.             printf("FAIL\n\t(%d): return value\n", i);
  2739.             return PR_FALSE;
  2740.         }
  2741.  
  2742.         if( 0 != PL_strncmp(result, array[i].cyphertext, clen) )
  2743.         {
  2744.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%.*s.\"\n", 
  2745.                    i, array[i].plaintext, array[i].cyphertext, clen, result);
  2746.             return PR_FALSE;
  2747.         }
  2748.     }
  2749.  
  2750.     printf("PASS\n");
  2751.     return PR_TRUE;
  2752. }
  2753.  
  2754. /* PL_Base64Encode, random strings, malloc */
  2755. PRBool test_024(void)
  2756. {
  2757.     int i;
  2758.  
  2759.     printf("Test 024 (PL_Base64Encode, random strings, malloc, strlen)            ..."); fflush(stdout);
  2760.  
  2761.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2762.     {
  2763.         PRUint32 plen = PL_strlen(array[i].plaintext);
  2764.         PRUint32 clen = ((plen + 2)/3)*4;
  2765.  
  2766.         char *rv = PL_Base64Encode(array[i].plaintext, 0, (char *)0);
  2767.  
  2768.         if( (char *)0 == rv )
  2769.         {
  2770.             printf("FAIL\n\t(%d): no return value\n", i);
  2771.             return PR_FALSE;
  2772.         }
  2773.  
  2774.         if( 0 != PL_strcmp(rv, array[i].cyphertext) )
  2775.         {
  2776.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%s.\"\n", 
  2777.                    i, array[i].plaintext, array[i].cyphertext, rv);
  2778.             return PR_FALSE;
  2779.         }
  2780.     }
  2781.  
  2782.     printf("PASS\n");
  2783.     return PR_TRUE;
  2784. }
  2785.  
  2786. /* PL_Base64Decode, random strings */
  2787. PRBool test_025(void)
  2788. {
  2789.     int i;
  2790.     char result[ 4096 ];
  2791.  
  2792.     printf("Test 025 (PL_Base64Decode, random strings, equals, strlen)            ..."); fflush(stdout);
  2793.  
  2794.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2795.     {
  2796.         PRUint32 clen = PL_strlen(array[i].cyphertext);
  2797.         PRUint32 plen = (clen * 3) / 4;
  2798.  
  2799.         char *rv = PL_Base64Decode(array[i].cyphertext, 0, result);
  2800.  
  2801.         if( rv != result )
  2802.         {
  2803.             printf("FAIL\n\t(%d): return value\n", i);
  2804.             return PR_FALSE;
  2805.         }
  2806.  
  2807.         if( 0 == (clen & 3) )
  2808.         {
  2809.             if( '=' == array[i].cyphertext[clen-1] )
  2810.             {
  2811.                 if( '=' == array[i].cyphertext[clen-2] )
  2812.                 {
  2813.                     plen -= 2;
  2814.                 }
  2815.                 else
  2816.                 {
  2817.                     plen -= 1;
  2818.                 }
  2819.             }
  2820.         }
  2821.  
  2822.         if( 0 != PL_strncmp(result, array[i].plaintext, plen) )
  2823.         {
  2824.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%.*s.\"\n", 
  2825.                    i, array[i].cyphertext, array[i].plaintext, plen, result);
  2826.             return PR_FALSE;
  2827.         }
  2828.     }
  2829.  
  2830.     printf("PASS\n");
  2831.     return PR_TRUE;
  2832. }
  2833.  
  2834. /* PL_Base64Decode, random strings */
  2835. PRBool test_026(void)
  2836. {
  2837.     int i;
  2838.     char buffer[ 4096 ];
  2839.     char result[ 4096 ];
  2840.     char *rv;
  2841.  
  2842.     printf("Test 026 (PL_Base64Decode, random strings, no equals, strlen)         ..."); fflush(stdout);
  2843.  
  2844.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2845.     {
  2846.         PRUint32 clen, plen;
  2847.  
  2848.         PL_strcpy(buffer, array[i].cyphertext);
  2849.         clen = PL_strlen(buffer);
  2850.  
  2851.         if( 0 == (clen & 3) )
  2852.         {
  2853.             if( '=' == buffer[clen-1] )
  2854.             {
  2855.                 if( '=' == buffer[clen-2] )
  2856.                 {
  2857.                     buffer[clen-2] = buffer[clen-1] = (char)0;
  2858.                     clen -= 2;
  2859.                 }
  2860.                 else
  2861.                 {
  2862.                     buffer[clen-1] = (char)0;
  2863.                     clen -= 1;
  2864.                 }
  2865.             }
  2866.         }
  2867.  
  2868.         plen = (clen * 3) / 4;
  2869.  
  2870.         rv = PL_Base64Decode(buffer, 0, result);
  2871.  
  2872.         if( rv != result )
  2873.         {
  2874.             printf("FAIL\n\t(%d): return value\n", i);
  2875.             return PR_FALSE;
  2876.         }
  2877.  
  2878.         if( 0 != PL_strncmp(result, array[i].plaintext, plen) )
  2879.         {
  2880.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%.*s.\"\n", 
  2881.                    i, array[i].cyphertext, array[i].plaintext, plen, result);
  2882.             return PR_FALSE;
  2883.         }
  2884.     }
  2885.  
  2886.     printf("PASS\n");
  2887.     return PR_TRUE;
  2888. }
  2889.  
  2890. /* PL_Base64Decode, random strings, malloc */
  2891. PRBool test_027(void)
  2892. {
  2893.     int i;
  2894.  
  2895.     printf("Test 027 (PL_Base64Decode, random strings, equals, malloc, strlen)    ..."); fflush(stdout);
  2896.  
  2897.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2898.     {
  2899.         PRUint32 clen = PL_strlen(array[i].cyphertext);
  2900.  
  2901.         char *rv = PL_Base64Decode(array[i].cyphertext, 0, (char *)0);
  2902.  
  2903.         if( (char *)0 == rv )
  2904.         {
  2905.             printf("FAIL\n\t(%d): no return value\n", i);
  2906.             return PR_FALSE;
  2907.         }
  2908.  
  2909.         if( 0 != PL_strcmp(rv, array[i].plaintext) )
  2910.         {
  2911.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%s.\"\n", 
  2912.                    i, array[i].cyphertext, array[i].plaintext, rv);
  2913.             PR_DELETE(rv);
  2914.             return PR_FALSE;
  2915.         }
  2916.  
  2917.         PR_DELETE(rv);
  2918.     }
  2919.  
  2920.     printf("PASS\n");
  2921.     return PR_TRUE;
  2922. }
  2923.  
  2924. /* PL_Base64Encode, random strings, malloc */
  2925. PRBool test_028(void)
  2926. {
  2927.     int i;
  2928.     char buffer[ 4096 ];
  2929.     char *rv;
  2930.  
  2931.     printf("Test 028 (PL_Base64Decode, random strings, no equals, malloc, strlen) ..."); fflush(stdout);
  2932.  
  2933.     for( i = 0; i < sizeof(array)/sizeof(array[0]); i++ )
  2934.     {
  2935.         PRUint32 clen;
  2936.  
  2937.         PL_strcpy(buffer, array[i].cyphertext);
  2938.         clen = PL_strlen(buffer);
  2939.  
  2940.         if( 0 == (clen & 3) )
  2941.         {
  2942.             if( '=' == buffer[clen-1] )
  2943.             {
  2944.                 if( '=' == buffer[clen-2] )
  2945.                 {
  2946.                     buffer[clen-2] = buffer[clen-1] = (char)0;
  2947.                     clen -= 2;
  2948.                 }
  2949.                 else
  2950.                 {
  2951.                     buffer[clen-1] = (char)0;
  2952.                     clen -= 1;
  2953.                 }
  2954.             }
  2955.         }
  2956.  
  2957.         rv = PL_Base64Decode(buffer, 0, (char *)0);
  2958.  
  2959.         if( (char *)0 == rv )
  2960.         {
  2961.             printf("FAIL\n\t(%d): no return value\n", i);
  2962.             return PR_FALSE;
  2963.         }
  2964.  
  2965.         if( 0 != PL_strcmp(rv, array[i].plaintext) )
  2966.         {
  2967.             printf("FAIL\n\t(%d, \"%s\"): expected \n\"%s,\" got \n\"%s.\"\n", 
  2968.                    i, array[i].cyphertext, array[i].plaintext, rv);
  2969.             return PR_FALSE;
  2970.         }
  2971.     }
  2972.  
  2973.     printf("PASS\n");
  2974.     return PR_TRUE;
  2975. }
  2976.  
  2977. int
  2978. main
  2979. (
  2980.     int     argc,
  2981.     char   *argv[]
  2982. )
  2983. {
  2984.     printf("Testing the Portable Library base64 functions:\n");
  2985.     printf("(warning: the \"triple characters\" tests are slow)\n");
  2986.  
  2987.     if( 1
  2988.         && test_001()
  2989.         && test_002()
  2990.         && test_003()
  2991.         && test_004()
  2992.         && test_005()
  2993.         && test_006()
  2994.         && test_007()
  2995.         && test_008()
  2996.         && test_009()
  2997.         && test_010()
  2998.         && test_011()
  2999.         && test_012()
  3000.         && test_013()
  3001.         && test_014()
  3002.         && test_015()
  3003.         && test_016()
  3004.         && test_017()
  3005.         && test_018()
  3006.         && test_019()
  3007.         && test_020()
  3008.         && test_021()
  3009.         && test_022()
  3010.         && test_023()
  3011.         && test_024()
  3012.         && test_025()
  3013.         && test_026()
  3014.         && test_027()
  3015.         && test_028()
  3016.       )
  3017.     {
  3018.         printf("Suite passed.\n");
  3019.         return 0;
  3020.     }
  3021.     else
  3022.     {
  3023.         printf("Suite failed.\n");
  3024.         return 1;
  3025.     }
  3026.  
  3027.     /*NOTREACHED*/
  3028. }
  3029.