开发者

Checksum on string

Is there a way to calculate a checksum on a string in Linux? The checksum commands that I have seen (cksum, md5sum, sha1sum, 开发者_JAVA百科etc.) all require a file as input and I do not have a file. I only have a path to a location and want to calculate the checksum on that path.


echo -n 'exampleString' | md5sum

should work.


echo -n "yourstring" |md5sum
echo -n "yourstring" |sha1sum
echo -n "yourstring" |sha256sum

don't forget -n or the result will change (cuz the newline will be parsed)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜