hash md5

For hash.

Hash a value using the md5 hash algorithm.

Command Type

built-in

Signature

> hash md5 {flags} ...rest

Flags

  • --binary, -b: Output binary instead of hexadecimal representation.

Parameters

  • ...rest: Optionally md5 hash data by cell path.

Input/output types:

input output
string oneof<string, binary>
binary oneof<string, binary>
list<string> list<oneof<string, binary>>
list<binary> list<oneof<string, binary>>
table table
record record

Examples

Return the md5 hash of a string, hex-encoded

> 'abcdefghijklmnopqrstuvwxyz' | hash md5
c3fcd3d76192e4007dfb496cca67e13b

Return the md5 hash of a string, as binary

> 'abcdefghijklmnopqrstuvwxyz' | hash md5 --binary
Length: 16 (0x10) bytes | null_char printable whitespace ascii_other non_ascii
00000000:   c3 fc d3 d7  61 92 e4 00  7d fb 49 6c  ca 67 e1 3b   ××××a××0}×Il×g×;

Return the md5 hash of binary data

> 0x[deadbeef] | hash md5

Return the md5 hash of a file’s contents

> open ./nu_0_24_1_windows.zip | hash md5

Return the md5 hash of a list of strings

> [abc def ghi] | hash md5
╭───┬──────────────────────────────────╮
│ 0 │ 900150983cd24fb0d6963f7d28e17f72 │
│ 1 │ 4ed9407630eb1000c0f6b63842defa7d │
│ 2 │ 826bbc5d0522f5f20a1da4b60fa8c871 │
╰───┴──────────────────────────────────╯

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.