|
@@ -876,11 +876,12 @@ class RNFetchBlobFS {
|
876
|
876
|
MessageDigest md = MessageDigest.getInstance(algorithms.get(algorithm));
|
877
|
877
|
|
878
|
878
|
FileInputStream inputStream = new FileInputStream(path);
|
879
|
|
- byte[] buffer = new byte[(int)file.length()];
|
|
879
|
+ int chunkSize = 4096 * 256; // 1Mb
|
|
880
|
+ byte[] buffer = new byte[chunkSize];
|
880
|
881
|
|
881
|
|
- int read;
|
882
|
|
- while ((read = inputStream.read(buffer)) != -1) {
|
883
|
|
- md.update(buffer, 0, read);
|
|
882
|
+ int bytesRead;
|
|
883
|
+ while ((bytesRead = inputStream.read(buffer)) != -1) {
|
|
884
|
+ md.update(buffer, 0, bytesRead);
|
884
|
885
|
}
|
885
|
886
|
|
886
|
887
|
StringBuilder hexString = new StringBuilder();
|