摘要
What is a checksum?
A checksum is a string of numbers and letters used to uniquely identify a file. Checksum is most commonly used to verify if a copy of a file is identical to an original, such as downloaded copies of ArcGIS product installation or patch files.
How does checksum work?
A file is pushed through an algorithm, which outputs a unique alphanumeric string called a checksum, also known as a "hash". Different files, even those with minute differences, produce different checksum values.
There are multiple algorithms that can be used to produce a checksum value. The checksum shown in MyEsri for older products uses the MD5 algorithm. Since the Fall 2021 product releases, SHA-256 checksums are displayed in MyEsri. However one can still use the 'Get-FileHash -Algorithm MD5' command described below to return the MD5 checksum for older products.
What circumstances would warrant verifying a checksum value?
Files may be changed during download, transmission, or storage. For example, if there is an issue with network connectivity at the time of download, the file may not download correctly. Issues with hard drive storage could also lead to file alteration.
Note:
Checksum can be used to verify any type of file. The steps provided in this article are specific to installers and executable files.
过程
How to verify the checksum of a file (Windows)
Note:
This procedure uses Windows PowerShell, included in Windows versions since Windows 7 and Windows Server 2008 R2. Versions of PowerShell for Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008 are available for download for both 32-bit and 64-bit platforms.
- Open Windows PowerShell from the Windows Search menu.
- At the prompt, type Get-FileHash, followed by a space, and drag-and-drop the file to be verified from the local download folder into the PowerShell window.
If the file is stored on a network drive, open the file directory either via a UNC path or a mapped letter drive in Windows File Explorer, then drag-and-drop the file into the PowerShell window as shown below. In the following image, the ArcGIS Pro 2.9 executable file was used. The full command at the prompt is:
Get-FileHash C:\Users\<username>\Downloads\ArcGISPro_29_179927.exe
- Press Enter, and the SHA-256 checksum is displayed, as shown in the following image.
- Compare the output checksum value to the checksum values provided by Esri. Product downloads can be verified with the Downloads page of My Esri:
- Go to My Esri.
- Click My Organizations.
- Click Downloads.
- Select View Downloads for the appropriate product and version.
- In the Download Components tab, expand Product Components, and locate the appropriate product.
- Click Additional Information to display the listed checksum.
- The Hash displayed in PowerShell can now be compared with the Checksum shown in MyEsri to verify the download, as seen in the following image.
Comparing the MD5 checksum
For older versions of Esri products, the MD5 hash is what is seen in MyEsri. So to verify downloads, the following PowerShell procedure can be used to compare the MD5 checksum of the downloaded file with MyEsri.
- Drag and drop the file to be verified from the local directory into the PowerShell window. If the file is stored on a network drive, open the file directory either via a UNC path or a mapped letter drive in Windows File Explorer, then drag and drop the file into the PowerShell window as shown below. In this example, the ArcGIS Pro 2.3 executable file is used.
- After the filename, press the spacebar and enter -Algorithm MD5 to ensure the MD5 algorithm is used. An example of the final command is displayed below, where <filepath> is the full path of the file. In this example, the path is 'C:\arcgis\ArcGISPro_23_167023.exe'.
Get-FileHash <filepath> -Algorithm MD5
- Press Enter. The output is the checksum value using the MD5 algorithm.
- Compare the output checksum value to the checksum values provided by Esri. Product downloads can be verified with the Downloads page of My Esri:
How to calculate the Checksum of a file (Linux)
- Change the directory to the location of the file.
- Type sha256sum then a space, followed by the full name of the file.
sha256sum log4shellmitigation.linux.zip
- Press Enter to execute the command. The output is the checksum value using the SHA-256 algorithm followed by the filename.
DDB01B31CF7B91270DF4410F502B17D42DC21232661400982D500E79C577897B log4shellmitigation.linux.zip
- Compare the output checksum value to the checksum values provided by Esri. Product downloads can be verified with the Downloads page of My Esri:
- Go to My Esri.
- Click My Organizations.
- Click Downloads.
- Select View Downloads for the appropriate product and version.
- In the Download Components tab, expand Product Components to locate the appropriate product.
- Click Additional Information to display the listed checksum.