def map_hash_to_range(hash_hex: str, range_min: int, range_max: int) -> int: """ Map a SHA-256 hash to a number within a given range. """ hash_int = int(hash_hex, 16) # Convert hex to integer return range_min + (hash_int % (range_max - range_min + 1))