I\'m trying to get the SHA256 of a string in Android.
Here is the PHP code that I want to match:
echo bin2hex(mhash(MHASH_SHA256,\"asdf\"));
//output
i know this has been answered but i found a Hashing Library at android arsenal and its very easy,simple and just one line of code. can hash MD5, SHA-1, SHA-256, SHA-384, or SHA-512.
first add this to your gradle and sync
implementation 'com.github.1AboveAll:Hasher:1.2'
start hasing
Hasher.Companion.hash("Hello",HashType.SHA_1);