cd

rwart

Created by: mgreen12206
Installed 1 times

Category: Array

Created on: Wednesday, March 12, 2025 at 1:41:49 AM

Updated on: Wednesday, March 12, 2025 at 10:01:39 AM

Tag arguments
[
   {
      "type": "string",
      "help": "This provides help on the argument",
      "defaultValue": "test"
   },
   {
      "type": "number",
      "help": "This provides help on the argument",
      "defaultValue": "0xff"
   },
   {
      "type": "quotelessString",
      "help": "This provides help on the argument",
      "defaultValue": "encode"
   },
   {
      "type": "boolean",
      "help": "This provides help on the argument",
      "defaultValue": "false"
   }
]
Code
class cd {
  encode(input, arg1) {
    //You should always implement this method
    //You can call other tags: hv.tags.hexEscape.encode('test')
    //You can access Hackvertor variables: hv.variables.foo
  }

  decode(input, arg1) {
    let output = decodeURIComponent(input);
    //This method is called to decode the input
    //This is optional. Remove it if not used.
    return output;
  }

  matches(input) {
    //this is used to automatically detect the encoding
    //This is optional
    //Always use ^ at the start with no $ at the end
    return /^(?:%[a-f0-9]{2})+/.exec(input);
  }
}