@CompileStatic class Hasher extends Object
Utility class to generate hashes/checksums for binary files. Typically used to generate a hashes for .class files to compare those files for equality.
Adapted from org.apache.maven.plugins.enforcer.Hasher
.
Type Params | Return Type | Name and description |
---|---|---|
|
String |
generateHash(ResolvedArtifact artifact)
|
Constructor.
classFilePath
- The path to the .class file. This is the file we'll generate a hash for.
Example: org/apache/maven/Stuff.class
artifact
- The artifact (example: jar file) which contains the classFilePath.
We'll generate a hash for the class file inside this artifact.