mirror of
https://github.com/gchq/CyberChef
synced 2025-12-19 01:33:45 +00:00
improve treatment of Hex(little endian) for Windows Filetime converter
This commit is contained in:
@@ -52,7 +52,10 @@ class WindowsFiletimeToUNIXTimestamp extends Operation {
|
||||
if (format === "Hex (little endian)") {
|
||||
// Swap endianness
|
||||
let result = "";
|
||||
for (let i = input.length - 2; i >= 0; i -= 2) {
|
||||
if (input.length % 2 !== 0) {
|
||||
result += input.charAt(input.length - 1);
|
||||
}
|
||||
for (let i = input.length - input.length % 2 - 2; i >= 0; i -= 2) {
|
||||
result += input.charAt(i);
|
||||
result += input.charAt(i + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user