MessageDigest
takes a string for what algorithm to use when you're about to hash. I've used some of the code here to accumulate a rather large list of 220 "algorithms" on my android device. I iterated through all of them using them as an algorithm in MessageDigest
and very few of them actually produce a hash.
How can I, at runtime, determine what hashes MessageDigest
will produce an output for without trying every one?
List the Services of each provider, then call the
getType()
method. If it isMessageDigest
, then this is a hash algorithm. Something like: