Documentation
¶
Index ¶
Constants ¶
View Source
const ( LevelCRC32 Level = 1 << iota // CRC32 only (fastest) LevelMD5 // MD5 LevelSHA1 // SHA1 LevelSHA256 // SHA256 LevelMinimal = LevelCRC32 LevelStandard = LevelCRC32 | LevelMD5 | LevelSHA1 LevelFull = LevelCRC32 | LevelMD5 | LevelSHA1 | LevelSHA256 )
Variables ¶
This section is empty.
Functions ¶
func VerifyCRC32 ¶
VerifyCRC32 checks if a file matches the expected CRC32.
Types ¶
type Result ¶
type Result struct {
CRC32 string `json:"crc32"`
MD5 string `json:"md5"`
SHA1 string `json:"sha1"`
SHA256 string `json:"sha256"`
Size int64 `json:"size"`
}
Result contains all computed checksums for a file.
func File ¶
File computes checksums for a file at the given path. It reads the file once, computing all requested hashes in a single pass.
The path is filepath.Clean'd before opening; callers are still expected to constrain inputs to trusted roots (scan results, DB rows) rather than raw user input. The Clean() step makes CodeQL's path-taint analysis happy.
Click to show internal directories.
Click to hide internal directories.