- Code: Select all
CA44EF10692C8B1C
How is it getting that?
I'm looking to reproduce that result externally. Some digging through Firefox source code suggests Firefox is computing the CityHash64 of the canonical path to the Firefox binary. So I tried creating a simple C++ program that directly uses the Mozilla code for CityHash, but it gets wildly different result from Firefox.
- Code: Select all
#include <iostream>
#include <string.h>
// CityHash implementation from Firefox:
// other-licenses/nsis/Contrib/CityHash/cityhash
#include "cityhash/city.h"
using namespace std;
int main(int argc, char* argv[]) {
if (argc == 2 && strcmp(argv[1], "--help") != 0) {
printf("%lX\n", CityHash64(argv[1], strlen(argv[1])));
return 0;
}
printf("usage: %s <string>\n", argv[0]);
return 1;
}
- Code: Select all
$ ./cityhash64 /opt/test/firefox/firefox
A1D6C94BC1323C0A
(I don't know C++ well at all, so maybe I just didn't write the program correctly?)