https://github.com/djwoodz/farming-simulator-hash
Outputs the hash of a given file using the same algorithm as the GIANTS `getFileMD5()` function.
https://github.com/djwoodz/farming-simulator-hash
farming-simulator farming-simulator-22 farming-simulator-25 fs22 fs25 hash md5 powershell
Last synced: over 1 year ago
JSON representation
Outputs the hash of a given file using the same algorithm as the GIANTS `getFileMD5()` function.
- Host: GitHub
- URL: https://github.com/djwoodz/farming-simulator-hash
- Owner: DJWoodZ
- License: mit
- Created: 2025-03-07T16:58:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-07T17:42:20.000Z (over 1 year ago)
- Last Synced: 2025-03-07T18:33:23.887Z (over 1 year ago)
- Topics: farming-simulator, farming-simulator-22, farming-simulator-25, fs22, fs25, hash, md5, powershell
- Language: PowerShell
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Farming Simulator Hash (getFileMD5)
===================================
This PowerShell script outputs the hash of a given file using the same algorithm as the GIANTS `getFileMD5()` function.
Usage
-----
```powershell
.\getFileMD5.ps1 [] [-Debug]
```
* ``: The path to the file to hash.
* ``: Optional. A custom base name to use instead of the file base name.
* `-Debug`: Optional. Enable debug information output.
Algorithm
---------
The algorithm is as follows:
1. Read the contents of the file.
2. Concatenate the file contents with the derived or provided base name (file name without extension).
3. Compute the MD5 hash of the concatenated data.
Example Usage
-------------
```powershell
.\getFileMD5.ps1 'file.zip'
```
```powershell
.\getFileMD5.ps1 'file.zip' 'My_Base_Name'
```
```powershell
.\getFileMD5.ps1 'file.zip' -Debug
```
```powershell
.\getFileMD5.ps1 'file.zip' 'My_Base_Name' -Debug
```
```powershell
.\getFileMD5.ps1 'C:\path\to\your\file.zip'
```
```powershell
.\getFileMD5.ps1 'C:\path\to\your\file.zip' 'My_Base_Name'
```
```powershell
.\getFileMD5.ps1 'C:\path\to\your\file.zip' -Debug
```
```powershell
.\getFileMD5.ps1 'C:\path\to\your\file.zip' 'My_Base_Name' -Debug
```