Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bradenhilton/mozillainstallhash
Go package which generates the hash used to differentiate between installs of Mozilla software
https://github.com/bradenhilton/mozillainstallhash
cityhash firefox go golang hash mozilla thunderbird
Last synced: 2 months ago
JSON representation
Go package which generates the hash used to differentiate between installs of Mozilla software
- Host: GitHub
- URL: https://github.com/bradenhilton/mozillainstallhash
- Owner: bradenhilton
- License: mit
- Created: 2021-06-23T21:43:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-24T17:46:04.000Z (over 1 year ago)
- Last Synced: 2024-06-19T19:43:55.425Z (6 months ago)
- Topics: cityhash, firefox, go, golang, hash, mozilla, thunderbird
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mozillainstallhash
Gets the hash used to differentiate between installs of Mozilla software in `installs.ini` and `profiles.ini`.
### Example
1. Create a new local Go module:
1. Create a new directory e.g. `$GOPATH/src/get_mozilla_install_hash`
2. Change into the newly created directory
3. Run `go mod init get_mozilla_install_hash`
2. Create a new file `get_mozilla_install_hash.go`:```go
package mainimport (
"fmt"
"log"
"os"
"strings""github.com/bradenhilton/mozillainstallhash"
)const usage = `
get_mozilla_install_hash
Get the hash used to differentiate between installs of Mozilla software.Usage:
get_mozilla_install_hash [ ...]Where is a string describing the parent directory of the executable,
e.g. "C:\Program Files\Mozilla Firefox", with platform specific path separators
("\" on Windows and "/" on Unix-like systems)Example:
get_mozilla_install_hash "C:\Program Files\Mozilla Firefox"
308046B0AF4A39CBget_mozilla_install_hash "C:/Program Files/Mozilla Firefox"
9D561FCD08DC6D55get_mozilla_install_hash "/usr/lib/firefox"
4F96D1932A9F858E`func main() {
if len(os.Args) == 1 {
log.Println(fmt.Errorf("error: no path specified"))
fmt.Println(usage)
os.Exit(1)
}paths := os.Args[1:]
for _, path := range paths {
path = strings.TrimSuffix(path, "/")
path = strings.TrimSuffix(path, "\\")hash, err := mozillainstallhash.MozillaInstallHash(path)
if err != nil {
log.Println(err)
continue
}fmt.Println(hash)
}
}
```3. Run `go get github.com/bradenhilton/mozillainstallhash`
4. Run `go run get_mozilla_install_hash.go `### License
MIT