mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-22 07:46:16 -04:00
Completion of simple filetime conversion
This commit is contained in:
parent
003e076b00
commit
ae38bb0927
2 changed files with 10 additions and 5 deletions
|
@ -1,5 +1,3 @@
|
|||
//import Decimal from "../lib/decimal.min.js";
|
||||
import Utils from "../Utils.js";
|
||||
import {BigInteger} from "jsbn";
|
||||
|
||||
/**
|
||||
|
@ -82,6 +80,13 @@ const DateTime = {
|
|||
},
|
||||
|
||||
|
||||
/**
|
||||
*@constant
|
||||
*@default
|
||||
*/
|
||||
RADIX: ["Decimal", "Hex"],
|
||||
|
||||
|
||||
/**
|
||||
* Converts a Windows FILETIME to Unix Epoch time.
|
||||
*
|
||||
|
@ -92,7 +97,7 @@ const DateTime = {
|
|||
*/
|
||||
runFromFiletimeToUnix: function(input, args) {
|
||||
let units = args[0], offset = new BigInteger("116444736000000000");
|
||||
input = new BigInteger(input,16).subtract(offset);
|
||||
input = new BigInteger(input).subtract(offset);
|
||||
if (units === "Seconds (s)"){
|
||||
input = input.divide(new BigInteger("10000000"));
|
||||
} else if (units === "Milliseconds (ms)") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue