Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // idResourceId 0.3 by infogram
- // Requires farmhash.cc & farmhash.h, and define FARMHASH_NO_BUILTIN_EXPECT in project properties
- // (needs one small modification to farmhash.cc: change farmhashxo::Hash64 to make it call farmhashna::Hash64 no matter what size)
- #include <iostream>
- #define WIN32_LEAN_AND_MEAN
- #include <Windows.h>
- #include "farmhash.h"
- int main(int argc, char* argv[])
- {
- printf("idResourceId 0.3 by infogram\n\n");
- if (argc < 2)
- {
- printf("usage: idResId.exe <resource/path> [resource-type]\n");
- printf("if resource-type isn't set, will use warehouseItem\n");
- return 1;
- }
- const char* resourceType = "warehouseItem";
- if (argc > 2)
- resourceType = argv[2];
- const char* resourcePath = argv[1];
- printf("Path: %s\n", resourcePath);
- printf("Type: %s\n\n", resourceType);
- util::uint128_t hash;
- // requires a small change to farmhashxo::Hash64, to make it call farmhashna::Hash64 no matter what size
- hash.second = util::Hash64(resourcePath, strlen(resourcePath));
- hash.first = util::Hash64(resourceType, strlen(resourceType));
- printf("Hash1: %llu\n", hash.first);
- printf("Hash2: %llu\n\n", hash.second);
- auto finalHash = util::Fingerprint(hash);
- printf("Result: %llu\n", finalHash);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement