executable-hash- Provides the SHA1 hash of the program executable

Safe HaskellNone



Internals related to reading and writing an injected executable hash.



injectedExecutableHash :: Q Exp Source #

This generates an expression which yields the injected SHA1 hash.

The generated expression yields a Just value when the injected SHA1 hash is present in the executable. This hash is usually injected due to a usage of injectExecutableHash / maybeInjectExecutableHash.

injectExecutableHash :: FilePath -> IO () Source #

Given the path to an executable, computes its hash and injects it into the binary, such that when that program demands the value of injectedExecutableHash, it yields a Just value.

See the documentation in System.Executable.Hash for an example of how to use this with a cabal postBuild hook

maybeInjectExecutableHash :: FilePath -> IO () Source #

Injects an executable hash into the specified binary. If it doesn't exist, then this prints a message to stdout indicating that it failed to inject the hash.