itinance / react-native-fs

Native filesystem access for react-native
MIT License
4.97k stars 986 forks source link

Wrong sha1 checksum for large files (around 1GB) #1229

Open scremona-navico opened 8 months ago

scremona-navico commented 8 months ago

The hash sha1 checksum for large files (1GB ish) on iOS, actual device, always gives back the same (wrong) value, regardless the size of the file. Smaller files (around 500MB) are fine. Tests on Simulator/Mac and Android actual device are fine.

// eg: download http://212.183.159.230/1GBFILE.zip 1,024 MB

const filePath = `${RNFS.DocumentDirectoryPath}/1GBFILE.zip`;
RNFS.hash(filePath, 'sha1').then(hash => console.log('sha1: ', hash));

// Expected value
      sha1:      86c210c323bda0d0b43a7cf2521b0657f0549286
// Output iOS
      sha1:      da39a3ee5e6b4b0d3255bfef95601890afd80709

iOS 15.8.1 "react": "17.0.2", "react-native": "0.67.5", "react-native-fs": "2.20.0",

birdofpreyru commented 8 months ago

Please, pay attention to the status & future of this library, noted in all recent issues opened in this repo!

#1197 — The future of react-native-fs

TL;DR.: This repo is stale, no active work happens here now. I actively maintain a fork of this project, but it lives, and it is managed through a different repo — https://github.com/birdofpreyru/react-native-fs.

scremona-navico commented 8 months ago

@birdofpreyru thank you. I'll check your fork and in the case I'll open there a ticket.