Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/generated/ts/structs.ts
2070 views
1
2
3
/**
4
* StructsPack returns a byte slice containing the values of msg slice packed according to the given format.
5
* The items of msg slice must match the values required by the format exactly.
6
* Ex: structs.pack("H", 0)
7
* @example
8
* ```javascript
9
* const structs = require('nuclei/structs');
10
* const packed = structs.Pack('H', [0]);
11
* ```
12
*/
13
export function Pack(formatStr: string, msg: any): Uint8Array | null {
14
return null;
15
}
16
17
18
19
/**
20
* StructsCalcSize returns the number of bytes needed to pack the values according to the given format.
21
* Ex: structs.CalcSize("H")
22
* @example
23
* ```javascript
24
* const structs = require('nuclei/structs');
25
* const size = structs.CalcSize('H');
26
* ```
27
*/
28
export function StructsCalcSize(format: string): number | null {
29
return null;
30
}
31
32
33
34
/**
35
* StructsUnpack the byte slice (presumably packed by Pack(format, msg)) according to the given format.
36
* The result is a []interface{} slice even if it contains exactly one item.
37
* The byte slice must contain not less the amount of data required by the format
38
* (len(msg) must more or equal CalcSize(format)).
39
* Ex: structs.Unpack(">I", buff[:nb])
40
* @example
41
* ```javascript
42
* const structs = require('nuclei/structs');
43
* const result = structs.Unpack('H', [0]);
44
* ```
45
*/
46
export function Unpack(format: string, msg: Uint8Array): any | null {
47
return null;
48
}
49
50
51