Fix export in big files

This commit is contained in:
Jordi Baylina 2020-05-26 21:19:35 +02:00
parent f587735530
commit d5ce479939
No known key found for this signature in database
GPG Key ID: 7480C80C1BE43112

View File

@ -61,10 +61,10 @@ async function exportChallange(pTauFilename, challangeFilename, verbose) {
async function exportSection(sectionId, groupName, nPoints, sectionName) {
const G = curve[groupName];
const sG = G.F.n8*2;
const nPointsChunk = Math.floor((1<<27)/sG);
const nPointsChunk = Math.floor((1<<24)/sG);
await binFileUtils.startReadUniqueSection(fdFrom, sections, sectionId);
for (let i=0; i< nPointsChunk; i+= nPointsChunk) {
for (let i=0; i< nPoints; i+= nPointsChunk) {
if ((verbose)&&i) console.log(`${sectionName}: ` + i);
const n = Math.min(nPoints-i, nPointsChunk);
let buff;