Random HTTP Entity Tag Comparison Cards Generator
Build a bounded reproducible http entity tag comparison cards from explicitly supplied candidate scenarios. Every candidate must satisfy imported http/etag-parser before selection; answer cards preserve its units, conventions, domain limitations and signed/unknown results. Draws are uniform over caller candidate positions; no replacement means no repeated positions, not necessarily distinct answers. No automatic pedagogical correctness, compliance or physical readiness. Compares each parsed candidate with explicit second entity tag: weak equality requires opaque equality, strong equality also requires neither tag weak; not precondition evaluation or cache freshness.
Description
HTTP entity tags identify representation versions and may carry a weak marker.
When to use Random HTTP Entity Tag Comparison Cards Generator
Use this tool when you need to assemble reproducible practice cards from a supplied, validated scenario corpus. Prepare a reproducible seed and the inventory, corpus, or experiment parameters stated below.
How to use Random HTTP Entity Tag Comparison Cards Generator and understand its results
- Prepare a reproducible seed and the inventory, corpus, or experiment parameters stated below.
- Enter seed, count, withoutReplacement, candidateInputsJson, comparisonEtag, following the field table and calculation rules below, then run the tool.
- Read result. For result objects, inspect the nested output fields below, including any missing evidence or selected indices.
- Correct any input issues and run again. Before using a successful result, review its units, signs, evidence coverage, and stated model or reference assumptions.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| seed | Required nonblank deterministic seed; the SDK can replace the source with context.random. | string | Required |
| count | Number of draws, cards, trials, or output entries under the tool-specific rule; safe integer 1–64 with any narrower inventory bound. | number | Required |
| withoutReplacement | True removes selected inventory positions; false permits repeated positions. Equal rendered values or answers can still occur. | boolean | Required |
| candidateInputsJson | Dense list of JSON objects serialized as strings for the imported calculator; every candidate must be valid. | list of string | Required |
| comparisonEtag | One strict quoted HTTP entity tag, optionally prefixed by uppercase W/, used for every selected comparison. | string | Required |
Enter 1–128 dense candidateInputsJson strings, each a strict JSON object for the imported calculator. Each string is at most 8192 UTF-16 units, the corpus at most 131072, and nesting at most 16 levels; nonfinite numbers and prototype-control keys are rejected. Select candidate positions under the sampling rules, then validate every candidate, including undrawn ones, by invoking the imported calculator with a fixed random source of 0.5. Any invalid candidate fails the whole request. Invoke it again for selected candidates with the request’s advancing source, and return original inputs, actual answer objects, selected indices, and never-selected indices. Duplicate candidate texts or equal answers may occur at distinct positions.3, 4, 5
Use a nonblank seed of at most 256 UTF-16 units and a safe-integer count from 1 to 64, subject to the tool’s narrower inventory bound. By default the seed is hashed into a deterministic pseudorandom state; each run restarts that state, so identical full inputs and implementation reproduce the result. The SDK may provide context.random, which replaces the seeded source and advances across the request; the seed remains required. Every source value must be finite in [0,1), with a request limit of 100000 source calls. Draw an index as floor(U×remainingSize). For indexed inventory draws, with replacement draw from the full inventory each time; without replacement remove each chosen position from an ordered pool and reject counts exceeding the inventory size. Uniform-source draws are over positions, not necessarily distinct values. This is not secure randomness.
The imported parser requires one quoted tag with optional uppercase W/ prefix and the permitted opaque-tag character range. It returns weak and opaqueValue for use in the comparison step below. Spaces outside the quotes, malformed quotes, and unsupported characters fail; backslashes are opaque characters rather than an escape decoder.
Parse comparisonEtag with the same strict imported parser before drawing candidates; a malformed comparison tag fails. For every selected candidate, return comparisonTag unchanged, weaklyEqual when opaque values match exactly, and stronglyEqual only when they match and neither parsed tag is weak. Backslashes in opaque values are literal rather than an escape decoder. These booleans do not evaluate request preconditions, freshness, or representation contents.
weaklyEqual=(opaqueCandidate=opaqueComparison); stronglyEqual=weaklyEqual and !candidateWeak and !comparisonWeak Read these symbols with the field meanings and branch or reference rules above.
| Output field | Meaning | Value type |
|---|---|---|
| result | Composite output; read its nested fields and the worked example. | object |
| result.baseToolId | Canonical identifier of the imported answer calculator. | string |
| result.selectedCandidateIndices | Zero-based positions in the original candidate corpus, in draw order. | list |
| result.unusedCandidateIndices | Original candidate positions never selected during this request. | list |
| result.exercises | Selected supplied input objects paired with their actual imported answer objects and any stated additional outputs. | list |
Each result.exercises entry preserves its supplied input and imported answer object. Additional roundTripAnswer, secondaryAnswer, prompts, or derived quantities appear only where the mechanics above describe them. selectedCandidateIndices and unusedCandidateIndices refer to the original corpus positions, not answer values.
{
"input": {
"seed": "tool.io/batch42",
"count": 1,
"withoutReplacement": true,
"candidateInputsJson": [
"{\"etag\": \"W/\\\"revision-7\\\"\"}"
],
"comparisonEtag": "\"revision-7\""
},
"output": {
"result": {
"baseToolId": "http/etag-parser",
"selectedCandidateIndices": [
0
],
"unusedCandidateIndices": [],
"exercises": [
{
"input": {
"etag": "W/\"revision-7\""
},
"answer": {
"weak": true,
"opaqueValue": "revision-7"
},
"comparisonTag": "\"revision-7\"",
"weaklyEqual": true,
"stronglyEqual": false
}
]
}
}
} Limitations and assumptions
Tag equality compares the supplied opaque strings under the stated weak/strong rules. It does not prove equivalent content, satisfy a complete conditional request, determine freshness, or fetch a representation. Each imported parser’s syntax rules still apply.
Missing required fields, unknown fields, wrong types, and violated calculation rules return input issues. Numeric values must be finite; nonfinite numeric outputs are rejected. Arrays must be dense, with no missing cells. Extremely large composite outputs are rejected.
Alternative or Complementary methods
For a related task, use Random HTTP Cache-Control Corpus Generator: Cache-Control contains directives that influence HTTP caching behavior. These fixtures tokenize supplied values into a lowercase directive record; they do not decide whether a response may be reused. For a complementary step, use Random HTTP Status Classification Quiz Generator: HTTP response status codes are grouped by their leading digit into five broad classes. This quiz samples supplied codes and classifies their numeric range, without checking whether a specific code is registered.
References
-
RFC 9110: HTTP Semantics — IETF
-
Calculation or validation: random/number — tool.io
Similar or alternative tools
- Random HTTP Cache-Control Corpus Generator
Cache-Control contains directives that influence HTTP caching behavior. These fixtures tokenize supplied values into a lowercase directive record; they do not decide whether a response may be reused.
- Random HTTP Status Classification Quiz Generator
HTTP response status codes are grouped by their leading digit into five broad classes. This quiz samples supplied codes and classifies their numeric range, without checking whether a specific code is registered.