digestForFile

fun digestForFile(resolvedModuleName: ResolvedModuleName, forceRefreshDigest: Boolean, withDigest: (ByteArray) -> Unit, failureHandler: (ErrorCode, Throwable?) -> Unit)

Determine the cryptographic hash of the file's current contents. Since we assume that the same filename and modification time implies the same digest, we cache the digest under that combination for performance.

Parameters

resolvedModuleName

The resolved name of the module, in case the backing source file must be read to produce a digest.

forceRefreshDigest

true forces a recalculation of the digest; false supplies the last known digest presuming the file has not changed.

withDigest

What to execute when the digest has been computed or looked up.

failureHandler

A function that accepts an ErrorCode and a nullable Throwable to be called in the event of failure.