diff -rup coreutils-9.5/src/digest.c coreutils-9.5-1/src/digest.c
--- coreutils-9.5/src/digest.c	2024-03-06 22:56:00.000000000 +0100
+++ coreutils-9.5-1/src/digest.c	2024-12-18 00:01:52.000000000 +0100
@@ -184,6 +184,9 @@ static size_t min_digest_line_length;
 /* Set to the length of a digest hex string for the selected algorithm.  */
 static size_t digest_hex_bytes;
 
+/* Output hash only, without file name.  */
+static bool hash_only = false;
+
 /* With --check, don't generate any output.
    The exit code indicates success or failure.  */
 static bool status_only = false;
@@ -383,6 +386,7 @@ static struct option const long_options[
 
 #if !HASH_ALGO_SUM
   { "check", no_argument, nullptr, 'c' },
+  { "hash", no_argument, nullptr, 'H' },
   { "ignore-missing", no_argument, nullptr, IGNORE_MISSING_OPTION},
   { "quiet", no_argument, nullptr, QUIET_OPTION },
   { "status", no_argument, nullptr, STATUS_OPTION },
@@ -469,6 +473,9 @@ Print or check %s (%d-bit) checksums.\n\
         fputs (_("\
   -c, --check           read checksums from the FILEs and check them\n\
 "), stdout);
+      fputs (_("\
+  -H, --hash            only print the checksum (hashing mode)\n\
+"), stdout);
 # if HASH_ALGO_BLAKE2 || HASH_ALGO_CKSUM
         fputs (_("\
   -l, --length=BITS     digest length in bits; must not exceed the max for\n\
@@ -1052,7 +1059,7 @@ output_file (char const *file, int binar
   if (needs_escape)
     putchar ('\\');
 
-  if (tagged)
+  if (tagged && !hash_only)
     {
       fputs (DIGEST_TYPE_STRING, stdout);
 # if HASH_ALGO_BLAKE2
@@ -1085,7 +1092,7 @@ output_file (char const *file, int binar
         printf ("%02x", bin_buffer[i]);
     }
 
-  if (!tagged)
+  if (!tagged && !hash_only)
     {
       putchar (' ');
       putchar (binary_file ? '*' : ' ');
@@ -1368,13 +1375,13 @@ main (int argc, char **argv)
 #if HASH_ALGO_SUM
   char const *short_opts = "rs";
 #elif HASH_ALGO_CKSUM
-  char const *short_opts = "a:l:bctwz";
+  char const *short_opts = "a:l:bcHtwz";
   char const *digest_length_str = "";
 #elif HASH_ALGO_BLAKE2
-  char const *short_opts = "l:bctwz";
+  char const *short_opts = "l:bcHtwz";
   char const *digest_length_str = "";
 #else
-  char const *short_opts = "bctwz";
+  char const *short_opts = "bcHtwz";
 #endif
 
   while ((opt = getopt_long (argc, argv, short_opts, long_options, nullptr))
@@ -1411,6 +1418,9 @@ main (int argc, char **argv)
       case 'b':
         binary = 1;
         break;
+      case 'H':
+        hash_only = true;
+        break;
       case 't':
         binary = 0;
         break;
