fn byte_for <'a>(word: &str) -> Option<(u8, bool)> {
match word {
"aardvark" => Some((0x00, true)),
"absurd" => Some((0x01, true)),
"accrue" => Some((0x02, true)),
"acme" => Some((0x03, true)),
"adrift" => Some((0x04, true)),
"adult" => Some((0x05, true)),
"afflict" => Some((0x06, true)),
"ahead" => Some((0x07, true)),
"aimless" => Some((0x08, true)),
"algol" => Some((0x09, true)),
"allow" => Some((0x0A, true)),
"alone" => Some((0x0B, true)),
"ammo" => Some((0x0C, true)),
"ancient" => Some((0x0D, true)),
"apple" => Some((0x0E, true)),
"artist" => Some((0x0F, true)),
"assume" => Some((0x10, true)),
"athens" => Some((0x11, true)),
"atlas" => Some((0x12, true)),
"aztec" => Some((0x13, true)),
"baboon" => Some((0x14, true)),
"backfield" => Some((0x15, true)),
"backward" => Some((0x16, true)),
"banjo" => Some((0x17, true)),
"beaming" => Some((0x18, true)),
"bedlamp" => Some((0x19, true)),
"beehive" => Some((0x1A, true)),
"beeswax" => Some((0x1B, true)),
"befriend" => Some((0x1C, true)),
"belfast" => Some((0x1D, true)),
"berserk" => Some((0x1E, true)),
"billiard" => Some((0x1F, true)),
"bison" => Some((0x20, true)),
"blackjack" => Some((0x21, true)),
"blockade" => Some((0x22, true)),
"blowtorch" => Some((0x23, true)),
"bluebird" => Some((0x24, true)),
"bombast" => Some((0x25, true)),
"bookshelf" => Some((0x26, true)),
"brackish" => Some((0x27, true)),
"breadline" => Some((0x28, true)),
"breakup" => Some((0x29, true)),
"brickyard" => Some((0x2A, true)),
"briefcase" => Some((0x2B, true)),
"burbank" => Some((0x2C, true)),
"button" => Some((0x2D, true)),
"buzzard" => Some((0x2E, true)),
"cement" => Some((0x2F, true)),
"chairlift" => Some((0x30, true)),
"chatter" => Some((0x31, true)),
"checkup" => Some((0x32, true)),
"chisel" => Some((0x33, true)),
"choking" => Some((0x34, true)),
"chopper" => Some((0x35, true)),
"christmas" => Some((0x36, true)),
"clamshell" => Some((0x37, true)),
"classic" => Some((0x38, true)),
"classroom" => Some((0x39, true)),
"cleanup" => Some((0x3A, true)),
"clockwork" => Some((0x3B, true)),
"cobra" => Some((0x3C, true)),
"commence" => Some((0x3D, true)),
"concert" => Some((0x3E, true)),
"cowbell" => Some((0x3F, true)),
"crackdown" => Some((0x40, true)),
"cranky" => Some((0x41, true)),
"crowfoot" => Some((0x42, true)),
"crucial" => Some((0x43, true)),
"crumpled" => Some((0x44, true)),
"crusade" => Some((0x45, true)),
"cubic" => Some((0x46, true)),
"dashboard" => Some((0x47, true)),
"deadbolt" => Some((0x48, true)),
"deckhand" => Some((0x49, true)),
"dogsled" => Some((0x4A, true)),
"dragnet" => Some((0x4B, true)),
"drainage" => Some((0x4C, true)),
"dreadful" => Some((0x4D, true)),
"drifter" => Some((0x4E, true)),
"dropper" => Some((0x4F, true)),
"drumbeat" => Some((0x50, true)),
"drunken" => Some((0x51, true)),
"dupont" => Some((0x52, true)),
"dwelling" => Some((0x53, true)),
"eating" => Some((0x54, true)),
"edict" => Some((0x55, true)),
"egghead" => Some((0x56, true)),
"eightball" => Some((0x57, true)),
"endorse" => Some((0x58, true)),
"endow" => Some((0x59, true)),
"enlist" => Some((0x5A, true)),
"erase" => Some((0x5B, true)),
"escape" => Some((0x5C, true)),
"exceed" => Some((0x5D, true)),
"eyeglass" => Some((0x5E, true)),
"eyetooth" => Some((0x5F, true)),
"facial" => Some((0x60, true)),
"fallout" => Some((0x61, true)),
"flagpole" => Some((0x62, true)),
"flatfoot" => Some((0x63, true)),
"flytrap" => Some((0x64, true)),
"fracture" => Some((0x65, true)),
"framework" => Some((0x66, true)),
"freedom" => Some((0x67, true)),
"frighten" => Some((0x68, true)),
"gazelle" => Some((0x69, true)),
"geiger" => Some((0x6A, true)),
"glitter" => Some((0x6B, true)),
"glucose" => Some((0x6C, true)),
"goggles" => Some((0x6D, true)),
"goldfish" => Some((0x6E, true)),
"gremlin" => Some((0x6F, true)),
"guidance" => Some((0x70, true)),
"hamlet" => Some((0x71, true)),
"highchair" => Some((0x72, true)),
"hockey" => Some((0x73, true)),
"indoors" => Some((0x74, true)),
"indulge" => Some((0x75, true)),
"inverse" => Some((0x76, true)),
"involve" => Some((0x77, true)),
"island" => Some((0x78, true)),
"jawbone" => Some((0x79, true)),
"keyboard" => Some((0x7A, true)),
"kickoff" => Some((0x7B, true)),
"kiwi" => Some((0x7C, true)),
"klaxon" => Some((0x7D, true)),
"locale" => Some((0x7E, true)),
"lockup" => Some((0x7F, true)),
"merit" => Some((0x80, true)),
"minnow" => Some((0x81, true)),
"miser" => Some((0x82, true)),
"mohawk" => Some((0x83, true)),
"mural" => Some((0x84, true)),
"music" => Some((0x85, true)),
"necklace" => Some((0x86, true)),
"neptune" => Some((0x87, true)),
"newborn" => Some((0x88, true)),
"nightbird" => Some((0x89, true)),
"oakland" => Some((0x8A, true)),
"obtuse" => Some((0x8B, true)),
"offload" => Some((0x8C, true)),
"optic" => Some((0x8D, true)),
"orca" => Some((0x8E, true)),
"payday" => Some((0x8F, true)),
"peachy" => Some((0x90, true)),
"pheasant" => Some((0x91, true)),
"physique" => Some((0x92, true)),
"playhouse" => Some((0x93, true)),
"pluto" => Some((0x94, true)),
"preclude" => Some((0x95, true)),
"prefer" => Some((0x96, true)),
"preshrunk" => Some((0x97, true)),
"printer" => Some((0x98, true)),
"prowler" => Some((0x99, true)),
"pupil" => Some((0x9A, true)),
"puppy" => Some((0x9B, true)),
"python" => Some((0x9C, true)),
"quadrant" => Some((0x9D, true)),
"quiver" => Some((0x9E, true)),
"quota" => Some((0x9F, true)),
"ragtime" => Some((0xA0, true)),
"ratchet" => Some((0xA1, true)),
"rebirth" => Some((0xA2, true)),
"reform" => Some((0xA3, true)),
"regain" => Some((0xA4, true)),
"reindeer" => Some((0xA5, true)),
"rematch" => Some((0xA6, true)),
"repay" => Some((0xA7, true)),
"retouch" => Some((0xA8, true)),
"revenge" => Some((0xA9, true)),
"reward" => Some((0xAA, true)),
"rhythm" => Some((0xAB, true)),
"ribcage" => Some((0xAC, true)),
"ringbolt" => Some((0xAD, true)),
"robust" => Some((0xAE, true)),
"rocker" => Some((0xAF, true)),
"ruffled" => Some((0xB0, true)),
"sailboat" => Some((0xB1, true)),
"sawdust" => Some((0xB2, true)),
"scallion" => Some((0xB3, true)),
"scenic" => Some((0xB4, true)),
"scorecard" => Some((0xB5, true)),
"scotland" => Some((0xB6, true)),
"seabird" => Some((0xB7, true)),
"select" => Some((0xB8, true)),
"sentence" => Some((0xB9, true)),
"shadow" => Some((0xBA, true)),
"shamrock" => Some((0xBB, true)),
"showgirl" => Some((0xBC, true)),
"skullcap" => Some((0xBD, true)),
"skydive" => Some((0xBE, true)),
"slingshot" => Some((0xBF, true)),
"slowdown" => Some((0xC0, true)),
"snapline" => Some((0xC1, true)),
"snapshot" => Some((0xC2, true)),
"snowcap" => Some((0xC3, true)),
"snowslide" => Some((0xC4, true)),
"solo" => Some((0xC5, true)),
"southward" => Some((0xC6, true)),
"soybean" => Some((0xC7, true)),
"spaniel" => Some((0xC8, true)),
"spearhead" => Some((0xC9, true)),
"spellbind" => Some((0xCA, true)),
"spheroid" => Some((0xCB, true)),
"spigot" => Some((0xCC, true)),
"spindle" => Some((0xCD, true)),
"spyglass" => Some((0xCE, true)),
"stagehand" => Some((0xCF, true)),
"stagnate" => Some((0xD0, true)),
"stairway" => Some((0xD1, true)),
"standard" => Some((0xD2, true)),
"stapler" => Some((0xD3, true)),
"steamship" => Some((0xD4, true)),
"sterling" => Some((0xD5, true)),
"stockman" => Some((0xD6, true)),
"stopwatch" => Some((0xD7, true)),
"stormy" => Some((0xD8, true)),
"sugar" => Some((0xD9, true)),
"surmount" => Some((0xDA, true)),
"suspense" => Some((0xDB, true)),
"sweatband" => Some((0xDC, true)),
"swelter" => Some((0xDD, true)),
"tactics" => Some((0xDE, true)),
"talon" => Some((0xDF, true)),
"tapeworm" => Some((0xE0, true)),
"tempest" => Some((0xE1, true)),
"tiger" => Some((0xE2, true)),
"tissue" => Some((0xE3, true)),
"tonic" => Some((0xE4, true)),
"topmost" => Some((0xE5, true)),
"tracker" => Some((0xE6, true)),
"transit" => Some((0xE7, true)),
"trauma" => Some((0xE8, true)),
"treadmill" => Some((0xE9, true)),
"trojan" => Some((0xEA, true)),
"trouble" => Some((0xEB, true)),
"tumor" => Some((0xEC, true)),
"tunnel" => Some((0xED, true)),
"tycoon" => Some((0xEE, true)),
"uncut" => Some((0xEF, true)),
"unearth" => Some((0xF0, true)),
"unwind" => Some((0xF1, true)),
"uproot" => Some((0xF2, true)),
"upset" => Some((0xF3, true)),
"upshot" => Some((0xF4, true)),
"vapor" => Some((0xF5, true)),
"village" => Some((0xF6, true)),
"virus" => Some((0xF7, true)),
"vulcan" => Some((0xF8, true)),
"waffle" => Some((0xF9, true)),
"wallet" => Some((0xFA, true)),
"watchword" => Some((0xFB, true)),
"wayside" => Some((0xFC, true)),
"willow" => Some((0xFD, true)),
"woodlark" => Some((0xFE, true)),
"zulu" => Some((0xFF, true)),
"adroitness" => Some((0x00, false)),
"adviser" => Some((0x01, false)),
"aftermath" => Some((0x02, false)),
"aggregate" => Some((0x03, false)),
"alkali" => Some((0x04, false)),
"almighty" => Some((0x05, false)),
"amulet" => Some((0x06, false)),
"amusement" => Some((0x07, false)),
"antenna" => Some((0x08, false)),
"applicant" => Some((0x09, false)),
"apollo" => Some((0x0A, false)),
"armistice" => Some((0x0B, false)),
"article" => Some((0x0C, false)),
"asteroid" => Some((0x0D, false)),
"atlantic" => Some((0x0E, false)),
"atmosphere" => Some((0x0F, false)),
"autopsy" => Some((0x10, false)),
"babylon" => Some((0x11, false)),
"backwater" => Some((0x12, false)),
"barbecue" => Some((0x13, false)),
"belowground" => Some((0x14, false)),
"bifocals" => Some((0x15, false)),
"bodyguard" => Some((0x16, false)),
"bookseller" => Some((0x17, false)),
"borderline" => Some((0x18, false)),
"bottomless" => Some((0x19, false)),
"bradbury" => Some((0x1A, false)),
"bravado" => Some((0x1B, false)),
"brazilian" => Some((0x1C, false)),
"breakaway" => Some((0x1D, false)),
"burlington" => Some((0x1E, false)),
"businessman" => Some((0x1F, false)),
"butterfat" => Some((0x20, false)),
"camelot" => Some((0x21, false)),
"candidate" => Some((0x22, false)),
"cannonball" => Some((0x23, false)),
"capricorn" => Some((0x24, false)),
"caravan" => Some((0x25, false)),
"caretaker" => Some((0x26, false)),
"celebrate" => Some((0x27, false)),
"cellulose" => Some((0x28, false)),
"certify" => Some((0x29, false)),
"chambermaid" => Some((0x2A, false)),
"cherokee" => Some((0x2B, false)),
"chicago" => Some((0x2C, false)),
"clergyman" => Some((0x2D, false)),
"coherence" => Some((0x2E, false)),
"combustion" => Some((0x2F, false)),
"commando" => Some((0x30, false)),
"company" => Some((0x31, false)),
"component" => Some((0x32, false)),
"concurrent" => Some((0x33, false)),
"confidence" => Some((0x34, false)),
"conformist" => Some((0x35, false)),
"congregate" => Some((0x36, false)),
"consensus" => Some((0x37, false)),
"consulting" => Some((0x38, false)),
"corporate" => Some((0x39, false)),
"corrosion" => Some((0x3A, false)),
"councilman" => Some((0x3B, false)),
"crossover" => Some((0x3C, false)),
"crucifix" => Some((0x3D, false)),
"cumbersome" => Some((0x3E, false)),
"customer" => Some((0x3F, false)),
"dakota" => Some((0x40, false)),
"decadence" => Some((0x41, false)),
"december" => Some((0x42, false)),
"decimal" => Some((0x43, false)),
"designing" => Some((0x44, false)),
"detector" => Some((0x45, false)),
"detergent" => Some((0x46, false)),
"determine" => Some((0x47, false)),
"dictator" => Some((0x48, false)),
"dinosaur" => Some((0x49, false)),
"direction" => Some((0x4A, false)),
"disable" => Some((0x4B, false)),
"disbelief" => Some((0x4C, false)),
"disruptive" => Some((0x4D, false)),
"distortion" => Some((0x4E, false)),
"document" => Some((0x4F, false)),
"embezzle" => Some((0x50, false)),
"enchanting" => Some((0x51, false)),
"enrollment" => Some((0x52, false)),
"enterprise" => Some((0x53, false)),
"equation" => Some((0x54, false)),
"equipment" => Some((0x55, false)),
"escapade" => Some((0x56, false)),
"eskimo" => Some((0x57, false)),
"everyday" => Some((0x58, false)),
"examine" => Some((0x59, false)),
"existence" => Some((0x5A, false)),
"exodus" => Some((0x5B, false)),
"fascinate" => Some((0x5C, false)),
"filament" => Some((0x5D, false)),
"finicky" => Some((0x5E, false)),
"forever" => Some((0x5F, false)),
"fortitude" => Some((0x60, false)),
"frequency" => Some((0x61, false)),
"gadgetry" => Some((0x62, false)),
"galveston" => Some((0x63, false)),
"getaway" => Some((0x64, false)),
"glossary" => Some((0x65, false)),
"gossamer" => Some((0x66, false)),
"graduate" => Some((0x67, false)),
"gravity" => Some((0x68, false)),
"guitarist" => Some((0x69, false)),
"hamburger" => Some((0x6A, false)),
"hamilton" => Some((0x6B, false)),
"handiwork" => Some((0x6C, false)),
"hazardous" => Some((0x6D, false)),
"headwaters" => Some((0x6E, false)),
"hemisphere" => Some((0x6F, false)),
"hesitate" => Some((0x70, false)),
"hideaway" => Some((0x71, false)),
"holiness" => Some((0x72, false)),
"hurricane" => Some((0x73, false)),
"hydraulic" => Some((0x74, false)),
"impartial" => Some((0x75, false)),
"impetus" => Some((0x76, false)),
"inception" => Some((0x77, false)),
"indigo" => Some((0x78, false)),
"inertia" => Some((0x79, false)),
"infancy" => Some((0x7A, false)),
"inferno" => Some((0x7B, false)),
"informant" => Some((0x7C, false)),
"insincere" => Some((0x7D, false)),
"insurgent" => Some((0x7E, false)),
"integrate" => Some((0x7F, false)),
"intention" => Some((0x80, false)),
"inventive" => Some((0x81, false)),
"istanbul" => Some((0x82, false)),
"jamaica" => Some((0x83, false)),
"jupiter" => Some((0x84, false)),
"leprosy" => Some((0x85, false)),
"letterhead" => Some((0x86, false)),
"liberty" => Some((0x87, false)),
"maritime" => Some((0x88, false)),
"matchmaker" => Some((0x89, false)),
"maverick" => Some((0x8A, false)),
"medusa" => Some((0x8B, false)),
"megaton" => Some((0x8C, false)),
"microscope" => Some((0x8D, false)),
"microwave" => Some((0x8E, false)),
"midsummer" => Some((0x8F, false)),
"millionaire" => Some((0x90, false)),
"miracle" => Some((0x91, false)),
"misnomer" => Some((0x92, false)),
"molasses" => Some((0x93, false)),
"molecule" => Some((0x94, false)),
"montana" => Some((0x95, false)),
"monument" => Some((0x96, false)),
"mosquito" => Some((0x97, false)),
"narrative" => Some((0x98, false)),
"nebula" => Some((0x99, false)),
"newsletter" => Some((0x9A, false)),
"norwegian" => Some((0x9B, false)),
"october" => Some((0x9C, false)),
"ohio" => Some((0x9D, false)),
"onlooker" => Some((0x9E, false)),
"opulent" => Some((0x9F, false)),
"orlando" => Some((0xA0, false)),
"outfielder" => Some((0xA1, false)),
"pacific" => Some((0xA2, false)),
"pandemic" => Some((0xA3, false)),
"pandora" => Some((0xA4, false)),
"paperweight" => Some((0xA5, false)),
"paragon" => Some((0xA6, false)),
"paragraph" => Some((0xA7, false)),
"paramount" => Some((0xA8, false)),
"passenger" => Some((0xA9, false)),
"pedigree" => Some((0xAA, false)),
"pegasus" => Some((0xAB, false)),
"penetrate" => Some((0xAC, false)),
"perceptive" => Some((0xAD, false)),
"performance" => Some((0xAE, false)),
"pharmacy" => Some((0xAF, false)),
"phonetic" => Some((0xB0, false)),
"photograph" => Some((0xB1, false)),
"pioneer" => Some((0xB2, false)),
"pocketful" => Some((0xB3, false)),
"politeness" => Some((0xB4, false)),
"positive" => Some((0xB5, false)),
"potato" => Some((0xB6, false)),
"processor" => Some((0xB7, false)),
"provincial" => Some((0xB8, false)),
"proximate" => Some((0xB9, false)),
"puberty" => Some((0xBA, false)),
"publisher" => Some((0xBB, false)),
"pyramid" => Some((0xBC, false)),
"quantity" => Some((0xBD, false)),
"racketeer" => Some((0xBE, false)),
"rebellion" => Some((0xBF, false)),
"recipe" => Some((0xC0, false)),
"recover" => Some((0xC1, false)),
"repellent" => Some((0xC2, false)),
"replica" => Some((0xC3, false)),
"reproduce" => Some((0xC4, false)),
"resistor" => Some((0xC5, false)),
"responsive" => Some((0xC6, false)),
"retraction" => Some((0xC7, false)),
"retrieval" => Some((0xC8, false)),
"retrospect" => Some((0xC9, false)),
"revenue" => Some((0xCA, false)),
"revival" => Some((0xCB, false)),
"revolver" => Some((0xCC, false)),
"sandalwood" => Some((0xCD, false)),
"sardonic" => Some((0xCE, false)),
"saturday" => Some((0xCF, false)),
"savagery" => Some((0xD0, false)),
"scavenger" => Some((0xD1, false)),
"sensation" => Some((0xD2, false)),
"sociable" => Some((0xD3, false)),
"souvenir" => Some((0xD4, false)),
"specialist" => Some((0xD5, false)),
"speculate" => Some((0xD6, false)),
"stethoscope" => Some((0xD7, false)),
"stupendous" => Some((0xD8, false)),
"supportive" => Some((0xD9, false)),
"surrender" => Some((0xDA, false)),
"suspicious" => Some((0xDB, false)),
"sympathy" => Some((0xDC, false)),
"tambourine" => Some((0xDD, false)),
"telephone" => Some((0xDE, false)),
"therapist" => Some((0xDF, false)),
"tobacco" => Some((0xE0, false)),
"tolerance" => Some((0xE1, false)),
"tomorrow" => Some((0xE2, false)),
"torpedo" => Some((0xE3, false)),
"tradition" => Some((0xE4, false)),
"travesty" => Some((0xE5, false)),
"trombonist" => Some((0xE6, false)),
"truncated" => Some((0xE7, false)),
"typewriter" => Some((0xE8, false)),
"ultimate" => Some((0xE9, false)),
"undaunted" => Some((0xEA, false)),
"underfoot" => Some((0xEB, false)),
"unicorn" => Some((0xEC, false)),
"unify" => Some((0xED, false)),
"universe" => Some((0xEE, false)),
"unravel" => Some((0xEF, false)),
"upcoming" => Some((0xF0, false)),
"vacancy" => Some((0xF1, false)),
"vagabond" => Some((0xF2, false)),
"vertigo" => Some((0xF3, false)),
"virginia" => Some((0xF4, false)),
"visitor" => Some((0xF5, false)),
"vocalist" => Some((0xF6, false)),
"voyager" => Some((0xF7, false)),
"warranty" => Some((0xF8, false)),
"waterloo" => Some((0xF9, false)),
"whimsical" => Some((0xFA, false)),
"wichita" => Some((0xFB, false)),
"wilmington" => Some((0xFC, false)),
"wyoming" => Some((0xFD, false)),
"yesteryear" => Some((0xFE, false)),
"yucatan" => Some((0xFF, false)),
_ => None
}
}
fn word_for <'a>(byte: u8, is_even: bool) -> &'a str {
if is_even {
match byte {
0x00 => "aardvark",
0x01 => "absurd",
0x02 => "accrue",
0x03 => "acme",
0x04 => "adrift",
0x05 => "adult",
0x06 => "afflict",
0x07 => "ahead",
0x08 => "aimless",
0x09 => "algol",
0x0A => "allow",
0x0B => "alone",
0x0C => "ammo",
0x0D => "ancient",
0x0E => "apple",
0x0F => "artist",
0x10 => "assume",
0x11 => "athens",
0x12 => "atlas",
0x13 => "aztec",
0x14 => "baboon",
0x15 => "backfield",
0x16 => "backward",
0x17 => "banjo",
0x18 => "beaming",
0x19 => "bedlamp",
0x1A => "beehive",
0x1B => "beeswax",
0x1C => "befriend",
0x1D => "belfast",
0x1E => "berserk",
0x1F => "billiard",
0x20 => "bison",
0x21 => "blackjack",
0x22 => "blockade",
0x23 => "blowtorch",
0x24 => "bluebird",
0x25 => "bombast",
0x26 => "bookshelf",
0x27 => "brackish",
0x28 => "breadline",
0x29 => "breakup",
0x2A => "brickyard",
0x2B => "briefcase",
0x2C => "burbank",
0x2D => "button",
0x2E => "buzzard",
0x2F => "cement",
0x30 => "chairlift",
0x31 => "chatter",
0x32 => "checkup",
0x33 => "chisel",
0x34 => "choking",
0x35 => "chopper",
0x36 => "christmas",
0x37 => "clamshell",
0x38 => "classic",
0x39 => "classroom",
0x3A => "cleanup",
0x3B => "clockwork",
0x3C => "cobra",
0x3D => "commence",
0x3E => "concert",
0x3F => "cowbell",
0x40 => "crackdown",
0x41 => "cranky",
0x42 => "crowfoot",
0x43 => "crucial",
0x44 => "crumpled",
0x45 => "crusade",
0x46 => "cubic",
0x47 => "dashboard",
0x48 => "deadbolt",
0x49 => "deckhand",
0x4A => "dogsled",
0x4B => "dragnet",
0x4C => "drainage",
0x4D => "dreadful",
0x4E => "drifter",
0x4F => "dropper",
0x50 => "drumbeat",
0x51 => "drunken",
0x52 => "dupont",
0x53 => "dwelling",
0x54 => "eating",
0x55 => "edict",
0x56 => "egghead",
0x57 => "eightball",
0x58 => "endorse",
0x59 => "endow",
0x5A => "enlist",
0x5B => "erase",
0x5C => "escape",
0x5D => "exceed",
0x5E => "eyeglass",
0x5F => "eyetooth",
0x60 => "facial",
0x61 => "fallout",
0x62 => "flagpole",
0x63 => "flatfoot",
0x64 => "flytrap",
0x65 => "fracture",
0x66 => "framework",
0x67 => "freedom",
0x68 => "frighten",
0x69 => "gazelle",
0x6A => "geiger",
0x6B => "glitter",
0x6C => "glucose",
0x6D => "goggles",
0x6E => "goldfish",
0x6F => "gremlin",
0x70 => "guidance",
0x71 => "hamlet",
0x72 => "highchair",
0x73 => "hockey",
0x74 => "indoors",
0x75 => "indulge",
0x76 => "inverse",
0x77 => "involve",
0x78 => "island",
0x79 => "jawbone",
0x7A => "keyboard",
0x7B => "kickoff",
0x7C => "kiwi",
0x7D => "klaxon",
0x7E => "locale",
0x7F => "lockup",
0x80 => "merit",
0x81 => "minnow",
0x82 => "miser",
0x83 => "mohawk",
0x84 => "mural",
0x85 => "music",
0x86 => "necklace",
0x87 => "neptune",
0x88 => "newborn",
0x89 => "nightbird",
0x8A => "oakland",
0x8B => "obtuse",
0x8C => "offload",
0x8D => "optic",
0x8E => "orca",
0x8F => "payday",
0x90 => "peachy",
0x91 => "pheasant",
0x92 => "physique",
0x93 => "playhouse",
0x94 => "pluto",
0x95 => "preclude",
0x96 => "prefer",
0x97 => "preshrunk",
0x98 => "printer",
0x99 => "prowler",
0x9A => "pupil",
0x9B => "puppy",
0x9C => "python",
0x9D => "quadrant",
0x9E => "quiver",
0x9F => "quota",
0xA0 => "ragtime",
0xA1 => "ratchet",
0xA2 => "rebirth",
0xA3 => "reform",
0xA4 => "regain",
0xA5 => "reindeer",
0xA6 => "rematch",
0xA7 => "repay",
0xA8 => "retouch",
0xA9 => "revenge",
0xAA => "reward",
0xAB => "rhythm",
0xAC => "ribcage",
0xAD => "ringbolt",
0xAE => "robust",
0xAF => "rocker",
0xB0 => "ruffled",
0xB1 => "sailboat",
0xB2 => "sawdust",
0xB3 => "scallion",
0xB4 => "scenic",
0xB5 => "scorecard",
0xB6 => "scotland",
0xB7 => "seabird",
0xB8 => "select",
0xB9 => "sentence",
0xBA => "shadow",
0xBB => "shamrock",
0xBC => "showgirl",
0xBD => "skullcap",
0xBE => "skydive",
0xBF => "slingshot",
0xC0 => "slowdown",
0xC1 => "snapline",
0xC2 => "snapshot",
0xC3 => "snowcap",
0xC4 => "snowslide",
0xC5 => "solo",
0xC6 => "southward",
0xC7 => "soybean",
0xC8 => "spaniel",
0xC9 => "spearhead",
0xCA => "spellbind",
0xCB => "spheroid",
0xCC => "spigot",
0xCD => "spindle",
0xCE => "spyglass",
0xCF => "stagehand",
0xD0 => "stagnate",
0xD1 => "stairway",
0xD2 => "standard",
0xD3 => "stapler",
0xD4 => "steamship",
0xD5 => "sterling",
0xD6 => "stockman",
0xD7 => "stopwatch",
0xD8 => "stormy",
0xD9 => "sugar",
0xDA => "surmount",
0xDB => "suspense",
0xDC => "sweatband",
0xDD => "swelter",
0xDE => "tactics",
0xDF => "talon",
0xE0 => "tapeworm",
0xE1 => "tempest",
0xE2 => "tiger",
0xE3 => "tissue",
0xE4 => "tonic",
0xE5 => "topmost",
0xE6 => "tracker",
0xE7 => "transit",
0xE8 => "trauma",
0xE9 => "treadmill",
0xEA => "trojan",
0xEB => "trouble",
0xEC => "tumor",
0xED => "tunnel",
0xEE => "tycoon",
0xEF => "uncut",
0xF0 => "unearth",
0xF1 => "unwind",
0xF2 => "uproot",
0xF3 => "upset",
0xF4 => "upshot",
0xF5 => "vapor",
0xF6 => "village",
0xF7 => "virus",
0xF8 => "vulcan",
0xF9 => "waffle",
0xFA => "wallet",
0xFB => "watchword",
0xFC => "wayside",
0xFD => "willow",
0xFE => "woodlark",
0xFF => "zulu",
_ => "DEADF00D"
}
} else {
match byte {
0x00 => "adroitness",
0x01 => "adviser",
0x02 => "aftermath",
0x03 => "aggregate",
0x04 => "alkali",
0x05 => "almighty",
0x06 => "amulet",
0x07 => "amusement",
0x08 => "antenna",
0x09 => "applicant",
0x0A => "apollo",
0x0B => "armistice",
0x0C => "article",
0x0D => "asteroid",
0x0E => "atlantic",
0x0F => "atmosphere",
0x10 => "autopsy",
0x11 => "babylon",
0x12 => "backwater",
0x13 => "barbecue",
0x14 => "belowground",
0x15 => "bifocals",
0x16 => "bodyguard",
0x17 => "bookseller",
0x18 => "borderline",
0x19 => "bottomless",
0x1A => "bradbury",
0x1B => "bravado",
0x1C => "brazilian",
0x1D => "breakaway",
0x1E => "burlington",
0x1F => "businessman",
0x20 => "butterfat",
0x21 => "camelot",
0x22 => "candidate",
0x23 => "cannonball",
0x24 => "capricorn",
0x25 => "caravan",
0x26 => "caretaker",
0x27 => "celebrate",
0x28 => "cellulose",
0x29 => "certify",
0x2A => "chambermaid",
0x2B => "cherokee",
0x2C => "chicago",
0x2D => "clergyman",
0x2E => "coherence",
0x2F => "combustion",
0x30 => "commando",
0x31 => "company",
0x32 => "component",
0x33 => "concurrent",
0x34 => "confidence",
0x35 => "conformist",
0x36 => "congregate",
0x37 => "consensus",
0x38 => "consulting",
0x39 => "corporate",
0x3A => "corrosion",
0x3B => "councilman",
0x3C => "crossover",
0x3D => "crucifix",
0x3E => "cumbersome",
0x3F => "customer",
0x40 => "dakota",
0x41 => "decadence",
0x42 => "december",
0x43 => "decimal",
0x44 => "designing",
0x45 => "detector",
0x46 => "detergent",
0x47 => "determine",
0x48 => "dictator",
0x49 => "dinosaur",
0x4A => "direction",
0x4B => "disable",
0x4C => "disbelief",
0x4D => "disruptive",
0x4E => "distortion",
0x4F => "document",
0x50 => "embezzle",
0x51 => "enchanting",
0x52 => "enrollment",
0x53 => "enterprise",
0x54 => "equation",
0x55 => "equipment",
0x56 => "escapade",
0x57 => "eskimo",
0x58 => "everyday",
0x59 => "examine",
0x5A => "existence",
0x5B => "exodus",
0x5C => "fascinate",
0x5D => "filament",
0x5E => "finicky",
0x5F => "forever",
0x60 => "fortitude",
0x61 => "frequency",
0x62 => "gadgetry",
0x63 => "galveston",
0x64 => "getaway",
0x65 => "glossary",
0x66 => "gossamer",
0x67 => "graduate",
0x68 => "gravity",
0x69 => "guitarist",
0x6A => "hamburger",
0x6B => "hamilton",
0x6C => "handiwork",
0x6D => "hazardous",
0x6E => "headwaters",
0x6F => "hemisphere",
0x70 => "hesitate",
0x71 => "hideaway",
0x72 => "holiness",
0x73 => "hurricane",
0x74 => "hydraulic",
0x75 => "impartial",
0x76 => "impetus",
0x77 => "inception",
0x78 => "indigo",
0x79 => "inertia",
0x7A => "infancy",
0x7B => "inferno",
0x7C => "informant",
0x7D => "insincere",
0x7E => "insurgent",
0x7F => "integrate",
0x80 => "intention",
0x81 => "inventive",
0x82 => "istanbul",
0x83 => "jamaica",
0x84 => "jupiter",
0x85 => "leprosy",
0x86 => "letterhead",
0x87 => "liberty",
0x88 => "maritime",
0x89 => "matchmaker",
0x8A => "maverick",
0x8B => "medusa",
0x8C => "megaton",
0x8D => "microscope",
0x8E => "microwave",
0x8F => "midsummer",
0x90 => "millionaire",
0x91 => "miracle",
0x92 => "misnomer",
0x93 => "molasses",
0x94 => "molecule",
0x95 => "montana",
0x96 => "monument",
0x97 => "mosquito",
0x98 => "narrative",
0x99 => "nebula",
0x9A => "newsletter",
0x9B => "norwegian",
0x9C => "october",
0x9D => "ohio",
0x9E => "onlooker",
0x9F => "opulent",
0xA0 => "orlando",
0xA1 => "outfielder",
0xA2 => "pacific",
0xA3 => "pandemic",
0xA4 => "pandora",
0xA5 => "paperweight",
0xA6 => "paragon",
0xA7 => "paragraph",
0xA8 => "paramount",
0xA9 => "passenger",
0xAA => "pedigree",
0xAB => "pegasus",
0xAC => "penetrate",
0xAD => "perceptive",
0xAE => "performance",
0xAF => "pharmacy",
0xB0 => "phonetic",
0xB1 => "photograph",
0xB2 => "pioneer",
0xB3 => "pocketful",
0xB4 => "politeness",
0xB5 => "positive",
0xB6 => "potato",
0xB7 => "processor",
0xB8 => "provincial",
0xB9 => "proximate",
0xBA => "puberty",
0xBB => "publisher",
0xBC => "pyramid",
0xBD => "quantity",
0xBE => "racketeer",
0xBF => "rebellion",
0xC0 => "recipe",
0xC1 => "recover",
0xC2 => "repellent",
0xC3 => "replica",
0xC4 => "reproduce",
0xC5 => "resistor",
0xC6 => "responsive",
0xC7 => "retraction",
0xC8 => "retrieval",
0xC9 => "retrospect",
0xCA => "revenue",
0xCB => "revival",
0xCC => "revolver",
0xCD => "sandalwood",
0xCE => "sardonic",
0xCF => "saturday",
0xD0 => "savagery",
0xD1 => "scavenger",
0xD2 => "sensation",
0xD3 => "sociable",
0xD4 => "souvenir",
0xD5 => "specialist",
0xD6 => "speculate",
0xD7 => "stethoscope",
0xD8 => "stupendous",
0xD9 => "supportive",
0xDA => "surrender",
0xDB => "suspicious",
0xDC => "sympathy",
0xDD => "tambourine",
0xDE => "telephone",
0xDF => "therapist",
0xE0 => "tobacco",
0xE1 => "tolerance",
0xE2 => "tomorrow",
0xE3 => "torpedo",
0xE4 => "tradition",
0xE5 => "travesty",
0xE6 => "trombonist",
0xE7 => "truncated",
0xE8 => "typewriter",
0xE9 => "ultimate",
0xEA => "undaunted",
0xEB => "underfoot",
0xEC => "unicorn",
0xED => "unify",
0xEE => "universe",
0xEF => "unravel",
0xF0 => "upcoming",
0xF1 => "vacancy",
0xF2 => "vagabond",
0xF3 => "vertigo",
0xF4 => "virginia",
0xF5 => "visitor",
0xF6 => "vocalist",
0xF7 => "voyager",
0xF8 => "warranty",
0xF9 => "waterloo",
0xFA => "whimsical",
0xFB => "wichita",
0xFC => "wilmington",
0xFD => "wyoming",
0xFE => "yesteryear",
0xFF => "yucatan",
_ => "DEADF00D"
}
}
}
pub fn to_bytes<S: AsRef<str>>(words: &[S]) -> Option<Vec<u8>> {
let mut bytes = Vec::with_capacity(words.len());
let mut is_even = true;
for word in words {
let byte_opt = byte_for(word.as_ref());
match byte_opt {
Some((byte, evenness)) => {
if evenness != is_even {
return None
}
bytes.push(byte);
is_even = !is_even;
},
None => return None
}
}
Some(bytes)
}
pub fn to_words(bytes: &[u8]) -> Vec<&str> {
let mut is_even = true;
let mut words = Vec::with_capacity(bytes.len());
for byte in bytes {
words.push(word_for(*byte, is_even));
is_even = !is_even;
}
words
}
#[cfg(test)]
mod tests {
#[test]
fn to_words_test() {
let msg: [u8; 4] = [0x2D, 0x6D, 0xED, 0x27];
let words = super::to_words(&msg);
assert_eq!(words[0], "button");
assert_eq!(words[1], "hazardous");
assert_eq!(words[2], "tunnel");
assert_eq!(words[3], "celebrate");
}
#[test]
fn no_deadfood_test() {
for byte in 0..255 {
assert!(super::word_for(byte, true) != "DEADF00D");
assert!(super::word_for(byte, false) != "DEADF00D");
}
}
#[test]
fn to_bytes_test() {
let mut words = Vec::new();
words.push("topmost");
words.push("istanbul");
words.push("pluto");
words.push("vagabond");
let bytes = super::to_bytes(&words);
assert!(bytes.is_some());
let bytes = bytes.unwrap();
assert_eq!(bytes[0], 0xE5);
assert_eq!(bytes[1], 0x82);
assert_eq!(bytes[2], 0x94);
assert_eq!(bytes[3], 0xF2);
}
#[test]
fn roundtrip_test() {
let msg: [u8; 20] = [
0xE5, 0x82, 0x94, 0xF2,
0xE9, 0xA2, 0x27, 0x48,
0x6E, 0x8B, 0x06, 0x1B,
0x31, 0xCC, 0x52, 0x8F,
0xD7, 0xFA, 0x3F, 0x19
];
let words = super::to_words(&msg);
assert_eq!(words, [
"topmost", "istanbul", "pluto", "vagabond",
"treadmill", "pacific", "brackish", "dictator",
"goldfish", "medusa", "afflict", "bravado",
"chatter", "revolver", "dupont", "midsummer",
"stopwatch", "whimsical", "cowbell", "bottomless"
]);
let bytes = super::to_bytes(&words);
assert!(bytes.is_some());
let bytes = bytes.unwrap();
assert_eq!(bytes, msg);
}
}