mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Syntax corrections for Lint
This commit is contained in:
parent
7cb1f1ff87
commit
66e35156cc
11 changed files with 25 additions and 25 deletions
|
@ -35,7 +35,7 @@ class FromChromeBrowserTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const d = moment.unix((input /1000000) - 11644473600);
|
||||
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
|
||||
} catch {
|
||||
|
|
|
@ -33,11 +33,11 @@ class FromHFSPlusTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const h = parseInt(input, 16);
|
||||
const d = moment.unix(h - 2082844800);
|
||||
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
|
||||
} catch{
|
||||
} catch {
|
||||
throw new OperationError("Unrecognised format");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class FromMacAbsoluteTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const d = moment.unix(input + 978307200);
|
||||
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
|
||||
} catch {
|
||||
|
|
|
@ -35,7 +35,7 @@ class FromUNIX32bitTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const h = parseInt(input, 16);
|
||||
const d = moment.unix(h);
|
||||
return d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss") + " UTC";
|
||||
|
|
|
@ -33,7 +33,7 @@ class FromWindows64bitTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const h = parseInt(input, 16);
|
||||
const secs = h/10000000;
|
||||
const d = moment.unix(secs - 11644473600);
|
||||
|
|
|
@ -41,7 +41,7 @@ class ToChromeBrowserTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const [showDateTime] = args,d = moment.utc(input);
|
||||
let result = ((d.unix()+11644473600) * 1000000);
|
||||
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();
|
||||
|
|
|
@ -42,7 +42,7 @@ class ToFirefoxBrowserTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const [showDateTime] = args,d = moment.utc(input);
|
||||
let result = (d.unix() * 1000000);
|
||||
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();
|
||||
|
|
|
@ -40,7 +40,7 @@ class ToHFSPlusTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const [showDateTime] = args,d = moment.utc(input);
|
||||
let result = d.unix();
|
||||
const hexString = (result + 2082844800).toString(16);
|
||||
|
|
|
@ -40,7 +40,7 @@ class ToMacAbsoluteTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const [showDateTime] = args,d = moment.utc(input);
|
||||
let result = (d.unix()-978307200);
|
||||
return showDateTime ? `${result} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : result.toString();
|
||||
|
|
|
@ -40,7 +40,7 @@ class ToUNIX32bitTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const [showDateTime] = args,d = moment.utc(input);
|
||||
let result = d.unix();
|
||||
const hexString = result.toString(16);
|
||||
|
|
|
@ -40,12 +40,12 @@ class ToWindows64bitTimestamp extends Operation {
|
|||
* @throws {OperationError} if invalid unit
|
||||
*/
|
||||
run(input, args) {
|
||||
try{
|
||||
try {
|
||||
const [showDateTime] = args,d = moment.utc(input);
|
||||
let result = d.unix();
|
||||
const step1 = result + 11644473600;
|
||||
const hexString = (step1 * 10000000).toString(16);
|
||||
eturn showDateTime ? `${hexString.toUpperCase()} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : hexString.toUpperCase();
|
||||
return showDateTime ? `${hexString.toUpperCase()} (${d.tz("UTC").format("ddd D MMMM YYYY HH:mm:ss")} UTC)` : hexString.toUpperCase();
|
||||
} catch {
|
||||
throw new OperationError("Unrecognised format");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue