While trying to use the 'hash' method on Android, I was getting the same error that the PR #395 fixed.
I did a local fix to have ti working.
Is there any possibility of fixing the hash method?
Below is my fix.
if (!algorithms.containsKey(algorithm)) throw new Exception("Invalid hash algorithm");
// File file = new File(filepath);
// if (file.isDirectory()) {
// rejectFileIsDirectory(promise);
// return;
// }
// if (!file.exists()) {
// rejectFileNotFound(promise, filepath);
// return;
// }
MessageDigest md = MessageDigest.getInstance(algorithms.get(algorithm));
// FileInputStream inputStream = new FileInputStream(filepath);
// byte[] buffer = new byte[(int) file.length()];
InputStream inputStream = getInputStream(filepath);
byte[] buffer = new byte[1024];
While trying to use the 'hash' method on Android, I was getting the same error that the PR #395 fixed.
I did a local fix to have ti working.
Is there any possibility of fixing the hash method?
Below is my fix.