如何连接code md5值到BASH的base64 [英] How to encode md5 sum into base64 in BASH

查看:135
本文介绍了如何连接code md5值到BASH的base64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要带code MD5哈希基地64.问题是,如果给md5sum命令输出为Base64命令,它被认为是一个文本,而不是作为一个十六进制数据。如何管理呢? Base64的命令没有选项来设置它的输入十六进制数。

I need to encode md5 hash to base 64. The problem is that if give output of md5sum command to base64 command, it is considered as a text and not as a hexadecimal data. How to manage it? Base64 command has no option to set it's input as a hexadecimal number.

感谢您的帮助。

推荐答案

使用 OpenSSL的DGST -md5 -binary 而不是的md5sum 。如果你愿意,你可以用它来的base64 EN code为好,只使用一个程序的所有用途。

Use openssl dgst -md5 -binary instead of md5sum. If you want, you can use it to base64-encode as well, to only use one program for all uses.

回声-n富| OpenSSL的DGST -md5 -binary | OpenSSL的ENC -base64

OpenSSL的MD5 而不是 OpenSSL的DGST -md5 工作过,但我认为这是更好还是明确)

(openssl md5 instead of openssl dgst -md5 works too, but I think it's better to be explicit)

这篇关于如何连接code md5值到BASH的base64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆