Dinalmask: Add exp to noise (#902)

* Finalmask: Add "tag" to noise items

* Finalmask: Rename noise "tag" to "exp"

* Finalmask: Move noise "exp" into "type"
This commit is contained in:
Cluvex
2026-10-03 14:11:21 +08:00
committed by GitHub
parent cbc4132383
commit f2b3064153
3 changed files with 39 additions and 3 deletions
+13 -1
View File
@@ -314,10 +314,22 @@ Noise sent before the actual data.
`randRange`: range of random-byte values. The default is `0-255`.
`type`: the type of `packet`. Supported values are `array`, `str`, `hex`, and `base64`. The default is `array`.
`type`: the type of `packet`. Supported values are `array`, `str`, `hex`, `base64`, and `exp`. The default is `array`.
`packet`: adds fixed data. Conflicts with `rand`.
With `"type": "exp"`, `packet` is an expression string that builds one noise packet, generated again on every send, so it can carry changing content such as a timestamp. The parts of the expression are joined in order into a single packet:
- `<b hex>`: fixed bytes written as hex, an optional `0x` prefix is ignored
- `<r N>` or `<r A-B>`: `N` random bytes, or a random count between `A` and `B`
- `<rc N>` or `<rc A-B>`: the same with random letters (`a-zA-Z`)
- `<rd N>` or `<rd A-B>`: the same with random digits (`0-9`)
- `<t>`: the current Unix time in seconds, 4 bytes big endian
- `<c>`: a counter, 4 bytes big endian, increased by one each time
- `<n>`: 8 random bytes
For example `{"type": "exp", "packet": "<b 0d0a0d0a><t><r 24>"}` sends `\r\n\r\n`, the timestamp and 24 random bytes as one packet.
`delay`: delay in milliseconds. After one noise item is sent, wait for the specified time before sending the next one.
### salamander