Skip to content

Instantly share code, notes, and snippets.

@jonalmeida
Created November 29, 2014 02:29
Show Gist options
  • Save jonalmeida/0054d0c89c93496940eb to your computer and use it in GitHub Desktop.
Save jonalmeida/0054d0c89c93496940eb to your computer and use it in GitHub Desktop.
ReverseTheHash
#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