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

  1. Choose the text, counts, explicit reference time or format parameters requested by this tool. Follow the stated byte, epoch-time and randomness assumptions.
  2. Enter characters using the field table and calculation rules, then run the tool.
  3. Read bits. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. 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 fieldMeaningValue type; see rules belowRequirement
charactersIndependent random hexadecimal character countinteger; minimum: 0; maximum: 9007199254740991Required

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 fieldMeaningValue type
bitsExact ideal bit capacitystring
json
{
  "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

  1. Random Hex Token Bits From Characters — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies