|
@@ -888,11 +888,12 @@ class RNFetchBlobFS {
|
888
|
888
|
MessageDigest md = MessageDigest.getInstance(algorithms.get(algorithm));
|
889
|
889
|
|
890
|
890
|
FileInputStream inputStream = new FileInputStream(path);
|
891
|
|
- byte[] buffer = new byte[(int)file.length()];
|
|
891
|
+ int chunkSize = 4096 * 256; // 1Mb
|
|
892
|
+ byte[] buffer = new byte[chunkSize];
|
892
|
893
|
|
893
|
|
- int read;
|
894
|
|
- while ((read = inputStream.read(buffer)) != -1) {
|
895
|
|
- md.update(buffer, 0, read);
|
|
894
|
+ int bytesRead;
|
|
895
|
+ while ((bytesRead = inputStream.read(buffer)) != -1) {
|
|
896
|
+ md.update(buffer, 0, bytesRead);
|
896
|
897
|
}
|
897
|
898
|
|
898
|
899
|
StringBuilder hexString = new StringBuilder();
|