Skip to content

Instantly share code, notes, and snippets.

@rndme
Created May 18, 2016 09:07
Show Gist options
  • Save rndme/5cc21f2d840892565c485ed359e41e7e to your computer and use it in GitHub Desktop.
Save rndme/5cc21f2d840892565c485ed359e41e7e to your computer and use it in GitHub Desktop.
function salad(numbers) { // word salad function for making (hopefully) human-memorable hashes for 64 digit strings (adapt as needed)
var r = "ability|able|about|above|accept|access|according|account|achieve|across|act|action|activity|actually|add|addition|admit|advantage|advice|affair|affect|after|again|against|age|ago|agree|agreement|air|all|allow|almost|along|already|also|although|always|among|amount|analysis|and|animal|announce|another|answer|any|anyone|anything|anyway|appear|application|apply|approach|appropriate|area|argue|argument|arm|army|around|arrive|art|ask|aspect|association|assume|attempt|attention|attitude|authority|available|avoid|award|aware|away|baby|back|bad|bank|base|basic|basis|bear|because|become|bed|before|begin|behavior|behind|believe|benefit|better|between|beyond|big|bill|bit|black|blood|board|body|book|both|box|boy|break|bring|brother|build|building|business|but|buy|call|campaign|can|capital|car|care|carry|case|catch|cause|cell|central|center|century|certain|certainly|chance|change|chapter|character|charge|child|choice|choose|church|circumstance|city|claim|class|clear|clearly|client|close|club|color|come|commission|committee|common|community|company|compare|competition|computer|concern|concerned|condition|conference|consider|contain|continue|contract|control|cos|cost|could|council|country|couple|course|court|cover|create|culture|cup|current|customer|cut|dark|data|date|daughter|day|dead|deal|death|decide|decision|defense|degree|demand|department|depend|describe|design|despite|detail|determine|develop|development|die|difference|different|difficult|difficulty|direction|director|discover|discuss|discussion|disease|division|doctor|dog|door|doubt|down|draw|drive|drop|due|during|duty|each|early|easy|eat|economic|economy|education|effect|effort|either|election|element|else|encourage|end|energy|enjoy|enough|ensure|enter|environment|especially|establish|even|evening|event|ever|every|everyone|everything|evidence|exactly|example|exist|expect|experience|explain|express|eye|face|fact|factor|fail|fall|family|far|father|feature|feel|feeling|few|field|fight|figure|fill|film|final|finally|financial|find|fine|finish|fire|firm|floor|fly|follow|following|food|foot|for|force|foreign|forget|form|former|forward|free|friend|from|front|full|function|fund|further|future|game|garden|general|generally|get|girl|give|glass|goal|good|government|great|ground|group|grow|growth|hair|half|hand|happen|happy|hard|have|head|health|hear|heart|heavy|help|her|here|herself|high|him|himself|his|history|hit|hold|home|hope|horse|hospital|hotel|hour|house|how|however|human|husband|idea|identify|image|important|improve|include|including|income|increase|indeed|indicate|individual|industrial|industry|information|instance|instead|institution|intend|interest|international|into|introduce|investment|involve|issue|item|its|itself|job|join|just|keep|kill|kind|king|know|knowledge|labor|land|language|large|last|late|later|law|lead|leader|learn|least|leave|left|leg|legal|less|let|letter|level|library|lie|life|light|like|likely|line|list|listen|little|live|local|long|look|lose|loss|lot|love|low|machine|main|maintain|major|majority|make|man|manage|management|manager|many|market|material|matter|may|maybe|mean|means|measure|meet|meeting|member|memory|mention|method|might|mile|military|mind|minister|minute|miss|model|modern|moment|money|month|more|morning|most|mother|move|movement|much|music|must|myself|name|national|natural|nature|near|nearly|necessary|need|never|new|news|next|nice|night|nor|normal|not|note|nothing|now|number|obtain|obviously|occur|off|offer|office|officer|often|oil|okay|old|once|one|only|open|operate|operation|opportunity|order|organisation|original|other|our|out|outside|over|own|page|paper|parent|part|particular|particularly|party|pass|patient|pattern|pay|people|per|percent|performance|perhaps|period|person|personal|pick|picture|piece|place|plan|plant|play|player|please|point|police|policy|political|poor|popular|population|position|possible|pound|power|practice|prepare|present|president|press|pressure|prevent|previous|price|prime|principle|private|probably|problem|procedure|process|produce|product|production|professional|profit|program|project|property|proposal|prove|provide|provision|public|publish|pull|pupil|purpose|put|quality|question|quickly|quite|raise|range|rate|rather|reach|read|ready|real|really|reason|receive|recent|recently|record|red|reduce|refer|reflect|refuse|region|relate|relation|relationship|remain|remember|remove|replace|report|represent|require|research|resource|respect|response|responsibility|rest|result|return|reveal|right|rise|risk|road|role|room|round|royal|rule|run|sale|same|save|say|scheme|school|science|sea|season|seat|secretary|section|sector|security|see|seek|seem|sell|send|sense|series|serious|serve|service|set|several|shall|share|she|shop|short|should|show|side|sign|significant|similar|simple|simply|since|single|sit|site|situation|size|skill|small|smile|social|society|some|someone|something|sometimes|son|soon|sorry|sort|sound|source|space|speak|special|specific|spend|staff|stage|stand|standard|start|state|statement|station|stay|step|still|stone|stop|story|street|strong|structure|student|study|style|subject|success|successful|such|suddenly|suffer|suggest|summer|support|suppose|sure|surface|system|table|take|talk|task|tax|teach|teacher|team|technique|technology|tell|tend|term|test|than|thank|that|the|their|them|themselves|then|theory|there|therefore|these|they|thing|think|this|those|though|thought|through|throughout|throw|thus|time|title|today|together|too|top|total|towards|town|trade|train|training|treat|treatment|tree|TRUE|try|turn|type|under|understand|union|unit|university|unless|until|upon|use|used|useful|user|usually|value|variety|various|version|very|view|village|visit|voice|wait|walk|wall|want|war|watch|water|way|wear|week|well|what|whatever|when|where|whether|which|while|white|who|whole|whom|whose|why|wide|wife|will|win|window|wish|with|within|without|woman|wonder|word|work|worker|world|would|write|wrong|yeah|year|yes|yesterday|yet|you|young|your|yourself".split("|");
function sig(key) {
key = String(key).replace(/\D/g, "").match(/\d{10}/g).map(function(aa, bb, cc) {
return(Number(aa.slice(0, 2)) + Number(aa.slice(2, 4)) + Number(aa.slice(4, 6)) + Number(aa.slice(6, 8)) + Number(aa.slice(8, 10))) / 500;
});
return key.map(function(a, b) {
return r[Math.floor(a * r.length) - (b % 2)];
}).filter(function(a, b, c) {
return c.indexOf(a) === b;
}).join(" ");
}
return sig(numbers);
}
//try with a random string of digits":
salad("3779292100323803906972912536888020482555576672414928341518419323");
// == "following learn pick language now encourage"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment