swap endianness argument added to Windows Filetime To Unix Timestamp
This commit is contained in:
parent
c9d9730726
commit
f6c8c9e76c
@ -35,6 +35,11 @@ class WindowsFiletimeToUNIXTimestamp extends Operation {
|
|||||||
"name": "Input format",
|
"name": "Input format",
|
||||||
"type": "option",
|
"type": "option",
|
||||||
"value": ["Decimal", "Hex"]
|
"value": ["Decimal", "Hex"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Swap Endianness",
|
||||||
|
"type": "boolean",
|
||||||
|
"value": false
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -45,7 +50,16 @@ class WindowsFiletimeToUNIXTimestamp extends Operation {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
run(input, args) {
|
run(input, args) {
|
||||||
const [units, format] = args;
|
const [units, format, swapEndianness] = args;
|
||||||
|
|
||||||
|
if (swapEndianness) {
|
||||||
|
let result = "";
|
||||||
|
for (let i = input.length - 2; i >= 0; i -= 2) {
|
||||||
|
result += input.charAt(i);
|
||||||
|
result += input.charAt(i + 1);
|
||||||
|
}
|
||||||
|
input = result;
|
||||||
|
}
|
||||||
|
|
||||||
if (!input) return "";
|
if (!input) return "";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user