Created
November 29, 2014 02:29
-
-
Save jonalmeida/0054d0c89c93496940eb to your computer and use it in GitHub Desktop.
ReverseTheHash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <inttypes.h> | |
int main( int argc, char *argv[] ) { | |
uint64_t h = 25180466553932; | |
std::string letters = "acdegilmnoprstuw"; | |
std::string answer = ""; | |
while (h != 7) { | |
int leftover = h % 37; | |
h = (h - leftover) / 37; | |
answer.insert(0, sizeof(char), letters[leftover]); | |
std::cout << " h: " << h << std::endl; | |
} | |
std::cout << answer << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment