Arc
Site
Created by: alirezachoubforoushi
Installed 1 times
Category: Array
Created on: Tuesday, November 19, 2024 at 3:19:52 PM
Updated on: Wednesday, November 20, 2024 at 5:32:25 PM
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 Arc {
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);
}
}