Firefox install hash

Discuss various technical topics not related to Mozilla.
Post Reply
User avatar
onemen
Posts: 1136
Joined: October 15th, 2004, 7:48 am

Firefox install hash

Post by onemen »

I'v read an old post form 2019 about how to generate Firefox install hash with CityHash64
http://forums.mozillazine.org/viewtopic.php?p=14880915#

Code: Select all

#include <iostream>
#include <string.h>
#include <locale>
#include <codecvt>

// 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) {
    u16string u16_conv = wstring_convert<codecvt_utf8_utf16<char16_t>, char16_t>{}.from_bytes(argv[1]);
    const char16_t* a1 = u16_conv.c_str();
    size_t len = char_traits<char16_t>::length(a1) * sizeof(*a1);
    printf("%lX\n", CityHash64(reinterpret_cast<const char*>(a1), len));
    return 0;
  }

  printf("usage: %s <string>\n", argv[0]);
  return 1;
}
this code doesn't work anymore...
can anyone point me to a working code?
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Firefox install hash

Post by therube »

Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
onemen
Posts: 1136
Joined: October 15th, 2004, 7:48 am

Re: Firefox install hash

Post by onemen »

Thanks, i was using wrong version of CityHash
Post Reply