Skip to content

Commit

Permalink
use BigInt to create big integers (fix #254)
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Jun 23, 2021
1 parent 2ec18d7 commit a8f0189
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/core/zip-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ function getDate(timeRaw) {
}

function getDateNTFS(timeRaw) {
return new Date((Number((timeRaw / 10000n) - 11644473600000n)));
return new Date((Number((timeRaw / BigInt(10000)) - BigInt(11644473600000))));
}

function getUint8(view, offset) {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/zip-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ async function writeBlob(writer, blob, start = 0) {

function getTimeNTFS(date) {
if (date) {
return ((BigInt(date.getTime()) + 11644473600000n) * 10000n);
return ((BigInt(date.getTime()) + BigInt(11644473600000)) * BigInt(10000));
}
}

Expand Down

0 comments on commit a8f0189

Please sign in to comment.