mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 04:26:04 +08:00
nshlib/md5: Support reading from standard input
Sometimes users may want to calculate the MD5 of part of a file(e.g. check partition contents for debug after flashing, size of which may be greater than image). This can be done with the "dd" command and pipes, the "md5" command just needs to support reading from standard input. For example: `dd if=/dev/virtblk0 bs=512 count=1 | md5`. Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:

committed by
Alan C. Assis

parent
ecd7b84871
commit
c3e628c45a
@@ -353,7 +353,8 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||
|
||||
#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_HASH_MD5)
|
||||
# ifndef CONFIG_NSH_DISABLE_MD5
|
||||
CMD_MAP("md5", cmd_md5, 2, 3, "[-f] <string or filepath>"),
|
||||
CMD_MAP("md5", cmd_md5, 1, 3,
|
||||
"[string] or [-f <filepath>] or read stdin"),
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user