Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // what we're working with
  2. var characterList = 'acdegilmnoprstuw';
  3.  
  4. // what we're going for
  5. var theHashWeWereLookingFor = 956446786872726;
  6.  
  7. var theMagicString = '';
  8. //Now reverse engineer
  9. while (theHashWeWereLookingFor > 7 ) {
  10. var counter = 0;
  11. while (counter < characterList.length) {
  12. if ((theHashWeWereLookingFor - counter) % 37 === 0) {
  13. //Add character to the solution
  14. theMagicString = (characterList[counter]) + theMagicString;
  15. break;
  16. }
  17. counter ++;
  18. }
  19.  
  20. theHashWeWereLookingFor = (theHashWeWereLookingFor - counter) / 37;
  21. }
  22.  
  23. //This the solution we were looking for
  24. //in just 50ms
  25. console.log(theMagicString);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement