Random Hex Token Bits From Characters
Return the ideal uniform-random capacity of a hexadecimal token from its number of independently random characters.
Description
Each uniformly random hexadecimal character has sixteen possible values and therefore carries four ideal bits.
Each uniformly random hexadecimal character has sixteen possible values and therefore carries four ideal bits. The capacity grows linearly only when the character choices are independent and uniformly distributed.1
Return the ideal uniform-random capacity of a hexadecimal token from its number of independently random characters.
When to use Random Hex Token Bits From Characters
Use this tool to return the ideal uniform-random capacity of a hexadecimal token from its number of independently random characters.
Choose the text, counts, explicit reference time or format parameters requested by this tool. Follow the stated byte, epoch-time and randomness assumptions.
How to use Random Hex Token Bits From Characters and understand its results
- Choose the text, counts, explicit reference time or format parameters requested by this tool. Follow the stated byte, epoch-time and randomness assumptions.
- Enter characters using the field table and calculation rules, then run the tool.
- Read bits. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| characters | Independent random hexadecimal character count | integer; minimum: 0; maximum: 9007199254740991 | Required |
Enter a nonnegative safe-integer count of independent random hex characters. Exact integer multiplication returns the ideal bit count as a decimal string, so large results are not rounded to a JavaScript number. Zero characters returns the string 0.
bits = 4 × characters Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| bits | Exact ideal bit capacity | string |
{
"input": {
"characters": 32
},
"output": {
"bits": "128"
}
} Limitations and assumptions
It does not inspect a token, count fixed separators, decode bytes or assess randomness. A predictable or biased token can have less entropy than this capacity. Count only random hex positions, excluding prefixes and fixed format bits where applicable.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Entropy Bits From Charset × Length: Calculate ideal entropy for independent uniform draws from a supplied character-set size. For a complementary task, use UUID v4 Fixed Randomness Bits Lookup: Report the 122 available random bits of a UUIDv4 after validating its canonical version and variant syntax.
References
-
Random Hex Token Bits From Characters — tool.io
Similar or alternative tools
- Entropy Bits From Charset × Length
Calculate ideal entropy for independent uniform draws from a supplied character-set size.
- UUID v4 Fixed Randomness Bits Lookup
Report the 122 available random bits of a UUIDv4 after validating its canonical version and variant syntax.