shasum -a 256 /path/to/your/HighSierra.dmg
If you have the .app file, you can create a DMG. If you are downloading a DMG from a third-party site, you must be cautious about security. Macos High Sierra Download Dmg
Open (found in Applications > Utilities). shasum -a 256 /path/to/your/HighSierra