{"id":25029057,"url":"https://github.com/danzek/gadhash","last_synced_at":"2025-04-13T16:09:53.510Z","repository":{"id":86883686,"uuid":"104698927","full_name":"danzek/gadhash","owner":"danzek","description":"CLI to calculate Google Analytics domain hash given list of domains","archived":false,"fork":false,"pushed_at":"2018-07-10T07:12:45.000Z","size":12811,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T16:09:48.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danzek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-25T03:23:54.000Z","updated_at":"2023-02-25T23:43:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b2b34b1-b48f-40fe-9868-de251b6a6144","html_url":"https://github.com/danzek/gadhash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danzek%2Fgadhash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danzek%2Fgadhash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danzek%2Fgadhash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danzek%2Fgadhash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danzek","download_url":"https://codeload.github.com/danzek/gadhash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741204,"owners_count":21154255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-05T20:57:50.885Z","updated_at":"2025-04-13T16:09:53.484Z","avatar_url":"https://github.com/danzek.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `gadhash`: Google Analytics Domain Hash Calculator\n\nCalculates Google Analytics domain hash given domain(s).\n\n### Contents\n\n - [Overview](#overview)\n - [Building](#building)\n   - [Dependencies](#dependencies)\n   - [CMake](#cmake)\n - [Usage](#usage)\n - [Rainbow Tables](#rainbow-tables)\n - [Contributing](#contributing)\n - [License, Disclaimers, etc.](#license-disclaimers-etc)\n\n## Overview\n\nWhen analyzing Google Analytics cookies, you will see an Urchin Tracking Module A (UTMA) value (utma=) in the URL. The part for comparison is only the number before the first dot (\".\"). For instance, in \"utma=173272373.nnnnn...\", the domain hash is 173272373 (\"google.com\", where n is any arbitrary number).\n\nEnter only the domain (without the protocol, i.e. don't include \"`http://`\") so that the domain hash will be calculated correctly. A hash value of 0 indicates an error.\n\nThis is a C++ CLI related to [the Windows GUI C# version I wrote previously](https://github.com/danzek/google-analytics-domain-hash-calculator).\n\n## Building\n\n`gadhash` has a single `main.cpp` file that contains all of the application code. As such, you can build the application using any compiler you are comfortable with that has C++11 support. CMake has been used to remain compiler-independent.\n\n### Dependencies\n\nThe following **Boost 1.61.0 libraries** are ***required*** dependencies for `gadhash`:\n\n - Boost.Program_options\n - Boost.Iostreams\n\n See [the Boost documentation for getting started on *nix.](http://www.boost.org/doc/libs/1_61_0/more/getting_started/unix-variants.html) (there is also [instructions for Windows](http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html) but note that `gadhash` intentionally targets Linux platforms\u0026mdash;I also wrote [a Windows GUI version](https://github.com/danzek/google-analytics-domain-hash-calculator), though, FYI).\n\n### CMake\n\n[Install CMake](https://cmake.org/install/) 3.8 or higher (if you don't already have it). This is a fairly new version so it may not be available in some package repositories. I recommend [downloading it from cmake.org](http://cmake.org/download/) and [following their installation instructions](https://cmake.org/install/).\n\nOnce you have CMake installed, you can generate a Makefile for your platform by invoking `cmake` and providing the path to the `CMakeLists.txt` file at the root of this repository. For example:\n\n    cmake ~/Documents/gadhash/CMakeLists.txt\n\nThis will generate a Makefile which you can then use to build the software:\n\n    make\n\nThis should result in a compiled binary being created for your system. You can also run `make install` if you choose to after this.\n\nAlternatively, you can just run `cmake --build [/path/to/CMakeLists.txt]` and it should build regardless of the build system on your platform (especially useful if it doesn't support `make`).\n\n## Usage\n\ngadhash expects a file (or `stdin`) containing a list of domains separated by newlines (`\\n`; *not* `\\r`\u0026mdash;be sure to use UNIX/LF line endings).\n\n    gadhash [OPTION(s)] [FILE(s)]\n\n    Options:\n      -h [ --help ]               get usage help\n      -v [ --version ]            display version\n      -d [ --delimiter ] arg (=,) specify output delimiter string (comma/CSV by\n                                  default; can be multiple characters)\n      -f [ --file ] arg           file(s) containing list of domains (one per\n                                  line); gadhash reads stdin if no file(s)\n                                  specified or a hyphen ('-') is given\n\nIf no options or file names are specified, gadhash will read from `stdin`.\n\n:warning: This uses `std::string` and assumes UTF-8 (POSIX)\u0026mdash;I made no attempt to deal with wide characters (neither `std::wstring` nor `wchar_t`) nor alternate line endings (CR, i.e. `\\r`) to support Windows. **I only intended for this to work on Linux.** That said, feel free to fork this code and make it support whatever you want it to! Keep in mind I already wrote [a Windows GUI version of this tool](https://github.com/danzek/google-analytics-domain-hash-calculator) (if there is interest, I can make that one support file input containing a list of domains, too).\n\n## Rainbow Tables\n\n[\"Rainbow tables\" of hashed domains have been made available](https://github.com/danzek/gadhash/tree/master/rainbowtbl) using `gadhash` to compute the Google Analytics (GA) domain hashes. This will enable interested parties to query a domain hash to find the corresponding domain.\n\n## Contributing\n\nI welcome contributions. Contact me at d@4n68r.com, create an issue, and/or fork this code and create a pull request.\n\n## License, Disclaimers, etc.\n\n*MIT License*\n\nCopyright \u0026copy; 2017 Dan O'Day (d@4n68r.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nThis project uses the `Boost` libraries for CLI argument parsing and memory-mapping files. Boost is distributed under the Boost Software License, Version 1.0 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt).\n\nThe hash function is based on [a StackOverflow answer](https://stackoverflow.com/a/16243868/) posted by user [Nico Westerdale](https://stackoverflow.com/users/768732/nico-westerdale) to [this question](https://stackoverflow.com/q/4821627/) posted by user [Alex Wayne](https://stackoverflow.com/users/62076/alex-wayne) (the answer is written in C#). StackOverflow user contributions are licensed under [cc by-sa 3.0](https://creativecommons.org/licenses/by-sa/3.0/) with [attribution required](https://stackoverflow.blog/2009/06/25/attribution-required/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanzek%2Fgadhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanzek%2Fgadhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanzek%2Fgadhash/lists"}