HELP: Cut hash value (HEX/BIN format only) or output length for SHAKE [0] TYPE: NUMBER SYNTAX: CUT=num
The 'cut' parameter defines the length of the checksum printed to log/output in bytes.
You can cut off leading bytes with a positive value and trailing bytes with a negative value. If the cut value is larger than checksum length, you get checksum length.
Supported only with HEX and BIN formats.
For example:
CUT= 0 ; HASH VALUE : cce7495bb08ef96a45e2e5e943b685ae25ba6d77 CUT= 2 ; HASH VALUE : cce7 CUT=-3 ; HASH VALUE : ba6d77
For the SHAKE algorithms 'cut' does not truncate a finished value, it selects how many bytes are produced, because these algorithms have no natural output length. A positive 'cut' is therefore the output length and it works in every output format, not only in HEX and BIN. It may also be larger than the default length, which is the whole point of an extendable-output function; the upper limit is 128 bytes.
Both readings agree wherever they overlap: the output of SHAKE is a stream, so the first n bytes of a longer value are exactly the n byte value. Asking for a shorter output and cutting a longer one give the same bytes.
A negative 'cut' keeps its usual meaning of "the last n bytes" and is applied to the default length afterwards, so it never extends the output and it still requires HEX or BIN format.
For example, with SHAKE256 whose default length is 64 bytes:
CUT= 0 ; 64 bytes, the default CUT= 32 ; 32 bytes, the first half of the value above CUT=100 ; 100 bytes, longer than the default CUT=-16 ; the last 16 bytes of the 64 byte default value