开发者

Why am I getting the same MD5 checksum for seemingly different inputs using Perl's Digest::MD5?

On my Linux platform with 64bits recompiled perl and SSHing Mac terminal (I guess UTF-8). I am giving all this information just in case it might be relevant.

# perl -e 'use Digest::MD5 qw/开发者_如何学Pythonmd5_hex/; print(md5_hex("alex@vi\n") ."\n");'
756e98065cb8cbf603a3dbef2afe9261

# perl -e 'use Digest::MD5 qw/md5_hex/; print(md5_hex("alex@visi\n") ."\n");'
756e98065cb8cbf603a3dbef2afe9261

# perl -e 'use Digest::MD5 qw/md5_hex/; print(md5_hex("alex@vision\n") ."\n");'
756e98065cb8cbf603a3dbef2afe9261

# perl -e 'use Digest::MD5 qw/md5_hex/; print(md5_hex("alex@visionten\n") ."\n");'
756e98065cb8cbf603a3dbef2afe9261

# perl -e 'use Digest::MD5 qw/md5_hex/; print(md5_hex("alex@visionten.\n") ."\n");'
d32e04de6906b3f284c6834b4d1d77c1

# perl -e 'use Digest::MD5 qw/md5_hex/; print(md5_hex("alex@\n") ."\n");'
264eca1047ccc6272ac2e338c695379e


You are using @ inside a double-quoted string. All of the @vision and @visionten things are evaluating to the same thing.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜