DI Management Home > Utilities > Generate file digest value

Generate file digest value


The Windows program digestvalue.exe is a freeware command-line program that computes the digest value in base64 encoding for a file or list of files. The base64-encoded digest value is suitable for inserting in the <DigestValue> node of an XML-DSIG document.

New 2022-02-07: added SHA-224, SHA-384 and SHA-512 digest algorithms.

For example, to compute the digest value of the file abc.txt using the default algorithm SHA-1:

> digestvalue abc.txt
qZk+NkcGgWq6PiVxeFDCbJzQ2J0=

If you want the more traditional sha1sum and md5sum freeware programs that generate the value in hexadecimal, see our Generate file checksums page.

Syntax

> digestvalue -h
Usage: digestvalue [[-1]|-2|-3|-4|-5|-m] [-x] [-h|v] [FILE]...
Compute the digest value for each FILE.
With no file, read standard input.
 -1    use SHA-1 digest algorithm (default)
 -2    use SHA-256 digest algorithm (default=SHA-1)
 -3    use SHA-384 digest algorithm (default=SHA-1)
 -4    use SHA-224 digest algorithm (default=SHA-1)
 -5    use SHA-512 digest algorithm (default=SHA-1)
 -m    use MD5 digest algorithm (default=SHA-1)
 -x    display digest in hex encoding (default=base64)
 -h    display this help and exit
 -v    output version information and exit

More examples

Specify files using a wildcard.
> digestvalue *.txt
98O8HYCOBHMq32eZZczDTKeuNEE=  123-9.txt
qZk+NkcGgWq6PiVxeFDCbJzQ2J0=  abc.txt
Kq5sNclPz7QV2+lfQIuc6R7oRu0=  hello.txt
iKW4Z8PRECB3huZlI80eSkhNppc=  hellon.txt
Compute the SHA-256 digest and display in hexadecimal.
> digestvalue -2x abc.txt
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Iterate through digest algorithms (SHA-1, SHA-224, SHA-256, ..., SHA-512)
> for %a in (1,4,2,3,5) do @digestvalue -x -%a abc.txt
a9993e364706816aba3e25717850c26c9cd0d89d
23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7
ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f
Check these against Test vectors for SHA-1, SHA-2 and SHA-3.

Enter a string value from the command line using "SET /p=<string>". Note no space between the end of the string and the '|'.

> echo | set /p=abc| digestvalue -x -2
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

> echo | set /p=hello world| digestvalue -x -2
b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9

Download

  1. Binaries: digestvalue-1.1.0.zip (69 kB) [sha1=a8f3401647c53690b901d5180cd4e2575dfba092]. The latest version is 1.1.0 compiled on 2022-02-07.

Install

To install, just copy the file digestvalue.exe to a folder on your Windows PATH, for example C:\Windows. You may need administrator permissions to copy the file. We recommend you set up a C:\Bin directory for files like this.

Contact us

To report a bug, comment on this page or to contact us, please send us a message.

This page first published 11 March 2017. Last updated 3 November 2023.