= Checksum

JReleaser calculates checksums for all input files and artifacts. These checksums are grouped into a single file named
`checksums.txt` which in turn may be signed and uploaded to a release.

Use the following options to customize how checksums are handled:

include::partial$legend.adoc[]

[tabs]
====
YAML::
+
[source,yaml]
[subs="+macros"]
----
# icon:dot-circle[]
checksum:
  # The name of the grouping checksums file.
  # Defaults to `checksums.txt`.
  # icon:dot-circle[] icon:file-alt[]
  name: '{{projectName}}-{{projectVersion}}_checksums.txt'

  # Algorithm to be used.
  # Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
  # Default value is `SHA256`.
  # `SHA256` is always configured.
  # icon:dot-circle[]
  algorithms:
    - MD5
    - SHA256
  
  # Uploads individual checksum files.
  # Defaults to `false`.
  # icon:dot-circle[]
  individual: true
----
TOML::
+
[source,toml]
[subs="+macros"]
----
# icon:dot-circle[]
[checksum]
  # The name of the grouping checksums file.
  # Defaults to `checksums.txt`.
  # icon:dot-circle[] icon:file-alt[]
  name = "{{projectName}}-{{projectVersion}}_checksums.txt"

  # Algorithm to be used.
  # Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
  # Default value is `SHA256`.
  # `SHA256` is always configured.
  # icon:dot-circle[]
  algorithms = ["MD5", "SHA256"]

  # Uploads individual checksum files.
  # Defaults to `false`.
  # icon:dot-circle[]
  individual = true
----
JSON::
+
[source,json]
[subs="+macros"]
----
{
  // icon:dot-circle[]
  "checksum": {

    // The name of the grouping checksums file.
    // Defaults to `checksums.txt`.
    // icon:dot-circle[] icon:file-alt[]
    "name": "{{projectName}}-{{projectVersion}}_checksums.txt",

    // Algorithm to be used.
    // Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
    // Default value is `SHA256`.
    // `SHA256` is always configured.
    // icon:dot-circle[]
    "algorithms": [
      "MD5",
      "SHA256"
    ],

    // Uploads individual checksum files.
    // Defaults to `false`.
    // icon:dot-circle[]
    "individual": true
  }
}
----
Maven::
+
[source,xml]
[subs="+macros,verbatim"]
----
<jreleaser>
  <!--
    icon:dot-circle[]
  -->
  <checksum>

    <!--
      The name of the grouping checksums file.
      Defaults to `checksums.txt`.
      icon:dot-circle[] icon:file-alt[]
    -->
    <name>{{projectName}}-{{projectVersion}}_checksums.txt</name>

    <!--
      Algorithm to be used.
      Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
      Default value is `SHA256`.
      `SHA256` is always configured.
      icon:dot-circle[]
    -->
    <algorithms>
        <algorithm>MD5</algorithm>
        <algorithm>SHA256</algorithm>
    </algorithms>

    <!--
      Uploads individual checksum files.
      Defaults to `false`.
      icon:dot-circle[]
    -->
    <individual>true</individual>
  </checksum>
</jreleaser>
----
Gradle::
+
[source,groovy]
[subs="+macros"]
----
jreleaser {
  // icon:dot-circle[]
  checksum {
    // The name of the grouping checksums file.
    // Defaults to `checksums.txt`.
    // icon:dot-circle[] icon:file-alt[]
    name = '{{projectName}}-{{projectVersion}}_checksums.txt'

    // Algorithm to be used.
    // Valid values are [`MD2`, `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`, `SHA3-224`, `SHA3-256`, `SHA3-384`, `SHA3-512`].
    // Default value is `SHA256`.
    // `SHA256` is always configured.
    // icon:dot-circle[]
    algorithm('MD5')
    algorithm('SHA256')

    // Uploads individual checksum files.
    // Defaults to `false`.
    // icon:dot-circle[]
    individual = true
  }
}
----
====
