MD5密码哈希函数输出在所有编程语言中都一样吗? [英] Will the MD5 cryptographic hash function output be same in all programming languages?

查看:162
本文介绍了MD5密码哈希函数输出在所有编程语言中都一样吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上是在php中创建一个API,它将接受的参数之一是md5加密值.我对不同的编程语言以及MD5不太了解.所以我的基本问题是,如果我接受md5加密的值,该值将保持不变,该值是由.NET,Java,Perl,Ruby ...等任何编程语言生成的.

I am basically creating an API in php, and one of the parameters that it will accept is an md5 encrypted value. I don't have much knowledge of different programming languages and also about the MD5. So my basic question is, if I am accepting md5 encrypted values, will the value remain same, generated from any programing language like .NET, Java, Perl, Ruby... etc.

否则会有一些限制或验证.

Or there would be some limitation or validations for it.

推荐答案

是的,正确实现md5会产生相同的结果,否则md5不能用作校验和.差异可能来自编码和字节顺序.您必须确保文本被编码为完全相同的字节序列.

Yes, correct implementation of md5 will produce the same result, otherwise md5 would not be useful as a checksum. The difference may come up with encoding and byte order. You must be sure that text is encoded to exactly the same sequence of bytes.

这篇关于MD5密码哈希函数输出在所有编程语言中都一样吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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