Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // what we're working with
- var characterList = 'acdegilmnoprstuw';
- // what we're going for
- var theHashWeWereLookingFor = 956446786872726;
- var theMagicString = '';
- //Now reverse engineer
- while (theHashWeWereLookingFor > 7 ) {
- var counter = 0;
- while (counter < characterList.length) {
- if ((theHashWeWereLookingFor - counter) % 37 === 0) {
- //Add character to the solution
- theMagicString = (characterList[counter]) + theMagicString;
- break;
- }
- counter ++;
- }
- theHashWeWereLookingFor = (theHashWeWereLookingFor - counter) / 37;
- }
- //This the solution we were looking for
- //in just 50ms
- console.log(theMagicString);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement