Skip to content

Commit 090a1e1

Browse files
committed
update README to show outputType functionality and new response types
1 parent ac9761f commit 090a1e1

File tree

1 file changed

+54
-6
lines changed

1 file changed

+54
-6
lines changed

README.md

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ curl -X POST -H "Content-Type:application/json" -d '{"input":"... ---:.-.. --- -
1717
```
1818
response:
1919
```
20-
SO LONG, AND THANKS FOR ALL THE FISH
20+
{
21+
value: "SO LONG, AND THANKS FOR ALL THE FISH",
22+
type: "string"
23+
}
2124
```
2225

2326

@@ -43,17 +46,25 @@ Currently the server just has one endpoint: `/bake`. This endpoint accepts a POS
4346
|---|---|---|
4447
input|String|The input data for the recipe. Currently accepts strings.
4548
recipe|String or Object or Array|One or more operations, with optional arguments. Uses default arguments if they're not defined here.
49+
outputType (optional)|String|The [Data Type](https://github.com/gchq/CyberChef/wiki/Adding-a-new-operation#data-types) that you would like the result of the bake to be returned as. This will not work with `File` or `List<File>` at the moment.
4650

4751
#### Example: one operation, default arguments
4852
```javascript
4953
{
5054
"input": "One, two, three, four.",
5155
"recipe": "to decimal"
5256
}
57+
```
58+
59+
Response:
60+
```javascript
61+
{
62+
value: "79 110 101 44 32 116 119 111 44 32 116 104 114 101 101 44 32 102 111 117 114 46",
63+
type: "string"
64+
}
5365

54-
// response: 79 110 101 44 32 116 119 111 44 32 116 104 114 101 101 44 32 102 111 117 114 46
5566
```
56-
For more information on how operation names are handled, see the [Node API docs](https://github.com/gchq/CyberChef/wiki/Node-API#operation-names)
67+
> For more information on how operation names are handled, see the [Node API docs](https://github.com/gchq/CyberChef/wiki/Node-API#operation-names)
5768
5869

5970
#### Example: one operation, non-default arguments by name
@@ -67,7 +78,13 @@ For more information on how operation names are handled, see the [Node API docs]
6778
}
6879
}
6980
}
70-
// response: 79:110:101:44:32:116:119:111:44:32:116:104:114:101:101:44:32:102:111:117:114:46
81+
```
82+
Response:
83+
```javascript
84+
{
85+
value: "79:110:101:44:32:116:119:111:44:32:116:104:114:101:101:44:32:102:111:117:114:46",
86+
type: "string"
87+
}
7188
```
7289

7390
#### Example: one operation, non-default arguments by position
@@ -79,7 +96,13 @@ For more information on how operation names are handled, see the [Node API docs]
7996
"args": ["Colon"]
8097
}
8198
}
82-
// response: 79:110:101:44:32:116:119:111:44:32:116:104:114:101:101:44:32:102:111:117:114:46
99+
```
100+
Response:
101+
```javascript
102+
{
103+
value: "79:110:101:44:32:116:119:111:44:32:116:104:114:101:101:44:32:102:111:117:114:46",
104+
type: "string"
105+
}
83106
```
84107

85108
#### Example: all together
@@ -100,10 +123,35 @@ For more information on how operation names are handled, see the [Node API docs]
100123
"MD4"
101124
]
102125
}
103-
// response: 31d6cfe0d16ae931b73c59d7e0c089c0
126+
127+
```
128+
Response:
129+
```javascript
130+
{
131+
value: "31d6cfe0d16ae931b73c59d7e0c089c0",
132+
type: "string"
133+
}
104134
```
105135

106136

137+
#### Example: Define outputType
138+
`toDecimal` has an outputType of `string`. Here we are asking to translate the output to a number before returning.
139+
```javascript
140+
{
141+
"input": "One, two, three, four.",
142+
"recipe": "to decimal",
143+
"outputType": "number"
144+
}
145+
```
146+
Response:
147+
```javascript
148+
{
149+
// Be wary, type conversions do not always behave as expected.
150+
"value": 79,
151+
"type": "number"
152+
}
153+
```
154+
107155
## Licencing
108156

109157
CyberChef-server is released under the [Apache 2.0 Licence](https://www.apache.org/licenses/LICENSE-2.0) and is covered by [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/).

0 commit comments

Comments
 (0)