mirror of
https://github.com/gchq/CyberChef.git
synced 2024-09-07 12:11:35 +02:00
42 lines
959 B
JavaScript
42 lines
959 B
JavaScript
/**
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
* @copyright Crown Copyright 2016
|
|
* @license Apache-2.0
|
|
*/
|
|
|
|
import r from "jsrsasign";
|
|
import Operation from "../Operation";
|
|
|
|
/**
|
|
* Hex to Object Identifier operation
|
|
*/
|
|
class HexToObjectIdentifier extends Operation {
|
|
|
|
/**
|
|
* HexToObjectIdentifier constructor
|
|
*/
|
|
constructor() {
|
|
super();
|
|
|
|
this.name = "Hex to Object Identifier";
|
|
this.module = "PublicKey";
|
|
this.description = "Converts a hexadecimal string into an object identifier (OID).";
|
|
this.infoURL = "https://wikipedia.org/wiki/Object_identifier";
|
|
this.inputType = "string";
|
|
this.outputType = "string";
|
|
this.args = [];
|
|
}
|
|
|
|
/**
|
|
* @param {string} input
|
|
* @param {Object[]} args
|
|
* @returns {string}
|
|
*/
|
|
run(input, args) {
|
|
return r.KJUR.asn1.ASN1Util.oidHexToInt(input.replace(/\s/g, ""));
|
|
}
|
|
|
|
}
|
|
|
|
export default HexToObjectIdentifier;
|