确保MD5可以与Android中的MessageDigest一起

确保MD5可以与Android中的MessageDigest一起

本文介绍了是否可以确保MD5可以与Android中的MessageDigest一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我直言忽略 MessageDigest.getInstance("MD5")可能引发的检查异常之前,我想知道MD5摘要算法是否保证在所有Android设备上都可用.

I want to know if the MD5 digest algorithm is guaranteed to be available in all Android devices before I bluntly ignore the checked exception that MessageDigest.getInstance("MD5") can throw.

推荐答案

Android JCE(Java密码学扩展)基于bouncycastle实现,但已被精简.bouncycastle提供了大量不同的MessageDigest,可在此处找到.

The Android JCE (Java Cryptography Extension) is based off the bouncycastle implementation but stripped down. bouncycastle provides a ton of different MessageDigests which can be found here.

不能保证每个Android设备都支持MD5,但它非常普遍,并且可能在Bouncycastle中受支持的所有设备上.如果您想知道设备是否支持MD5,则可以检查设备支持的算法.有关更多信息,请此处.

There's no guarantee that every Android device supports MD5 but it's extremely common and is likely to be on every device as it's supported in bouncycastle. If you want to know if the device supports MD5 you can check the algorithms the device supports. More on that is here.

这篇关于是否可以确保MD5可以与Android中的MessageDigest一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 14:22