我在linux命令行下获取md5sum是这样子:
echo 123456 | md5sum
但这样跟编程语言相比,有很大不同。因为echo会自动在行尾追加"\n"符号,我以前写博文也讨论过这个问题。
应该这样做:
echo -n 123456 | md5sum
参考 :
How to get the MD5 hash of a string directly in the terminal?
我在linux命令行下获取md5sum是这样子:
echo 123456 | md5sum
但这样跟编程语言相比,有很大不同。因为echo会自动在行尾追加"\n"符号,我以前写博文也讨论过这个问题。
应该这样做:
echo -n 123456 | md5sum
参考 :
How to get the MD5 hash of a string directly in the terminal?
转载于:https://my.oschina.net/u/191928/blog/639374