I want to calculate hash(SHA-256) of a file. This File is selected from chooser implemented using Intent. How can I calculate hash of the file whose path is obtained as below.
Intent use:
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
startActivityForResult(intent, 7);
in onActivityResult() I am obtaining the path as below:
if(requestCode == 7){
if (resultCode == RESULT_OK) {
String Path = data.getData().getPath();
}
I tried various answers provided on stackoverflow but none of them worked.