diff --git a/android/src/main/java/com/rnfs/RNFSManager.java b/android/src/main/java/com/rnfs/RNFSManager.java index 1fd3fd20..691484f6 100755 --- a/android/src/main/java/com/rnfs/RNFSManager.java +++ b/android/src/main/java/com/rnfs/RNFSManager.java @@ -323,21 +323,9 @@ public void hash(String filepath, String algorithm, Promise promise) { 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); + InputStream inputStream = getInputStream(filepath); byte[] buffer = new byte[1024 * 10]; // 10 KB Buffer int read;