Secure random strings and Entropy
This tool uses a browser crypto.getRandomValues() Obtain the cryptographically secure random numbers provided by the operating system, and then use rejection sampling to avoid deviations caused by simple modulation. It is suitable for creating test identification codes, temporary Tokens, Nonces, file names and unpredictable strings; if used in a formal authentication system, it still needs to cooperate with the server-side life cycle, hash storage and permission control.
The theoretical entropy value of a general repeatable pattern is approximately 長度 × log₂(字元池大小). When unique characters are enabled, the number of possible combinations decreases with each draw, so the tool estimates based on the number of characters that can be selected one at a time. Entropy measures the space of possibilities and does not mean that a string is necessarily safe in a specific system.
How to choose the format?
- General strings: Fine control of capitalization, numbers, symbols and custom characters.
- URL Safe: Use only alphanumeric characters, hyphens, and underscores that fit within the URL fragment.
- Hex: Contains only 0–9 and a–f, suitable for color, hash fragments, or low-level data representation.
- Alphanumeric characters: Avoid symbols causing escape problems in forms or command lines.