(payload: Binary)
| 204 | } |
| 205 | |
| 206 | function parsePayload(payload: Binary) { |
| 207 | const payloadStr = ByteUtils.toUTF8(payload.buffer, 0, payload.position, false); |
| 208 | const dict: Document = {}; |
| 209 | const parts = payloadStr.split(','); |
| 210 | for (let i = 0; i < parts.length; i++) { |
| 211 | const valueParts = (parts[i].match(/^([^=]*)=(.*)$/) ?? []).slice(1); |
| 212 | dict[valueParts[0]] = valueParts[1]; |
| 213 | } |
| 214 | return dict; |
| 215 | } |
| 216 | |
| 217 | function passwordDigest(username: string, password: string) { |
| 218 | if (typeof username !== 'string') { |
no test coverage detected