Is there any way to generate a checksum for a folder in Gradle?

As a continuation of the following ticket, Could you please let us know how to calculate the checksum for folders in Gradle way?

The answer didn’t change.
There is nothing built-in to generate checksums.
You can search for some plugin on that does it or code it yourself.

Can we use any internal services to calculate for single file and merge the hashcodes?

Just use normal Java classes to calculate the checksum like with Kotlin:

MessageDigest.getInstance("SHA-256").let { sha256 ->
    ).let {
        BigInteger(1, it)
            .padStart(sha256.digestLength * 2, '0')