(fields)
| 279 | return fields; |
| 280 | } |
| 281 | |
| 282 | function processFields(fields) { |
| 283 | const processed = [...fields]; |
| 284 | const currentTimestamp = Date.now(); |
| 285 | |
| 286 | // 替换哈希字段 |
| 287 | for (const [index, type] of Object.entries(HASH_FIELDS)) { |
| 288 | const idx = parseInt(index); |
| 289 | |
| 290 | if (type === 'split') { |
| 291 | // 字段16: 格式为 "count|hash",只替换hash部分 |
| 292 | const parts = processed[idx].split('|'); |
| 293 | if (parts.length === 2) { |
| 294 | processed[idx] = `${parts[0]}|${randomHash()}`; |
| 295 | } |
| 296 | } else if (type === 'full') { |
| 297 | // 完全替换为随机哈希 |
| 298 | if (idx === 36) { |
| 299 | // 字段36: 文档属性哈希(10-100的随机整数) |
| 300 | processed[idx] = Math.floor(Math.random() * 91) + 10; |
| 301 | } else { |
| 302 | processed[idx] = randomHash(); |
| 303 | } |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | processed[33] = currentTimestamp; // 字段33: 当前时间戳 |
| 308 | |
| 309 | return processed; |
| 310 | } |
| 311 | |
| 312 | // ==================== Cookie生成 ==================== |
no test coverage detected