public static function random_string(int $length=10, $soup=null) {
		if ($length < 1) {
			return '';
		}

		if (\is_array($soup) && \count($soup)) {
			ref\cast::string($soup);

			$soup = \implode('', $soup);
			ref\sanitize::printable($soup);

			$soup = \preg_replace('/\s/u', '', $soup);
			$soup = \array_unique(mb::str_split($soup, 1, true));
			$soup = \array_values($soup);
			if (! \count($soup)) {
				return '';
			}
		}

		// Use default soup.
		if (! \is_array($soup) || ! \count($soup)) {
			$soup = constants::RANDOM_CHARS;
		}

		// Pick nine entries at random.
		$salt = '';
		$max = \count($soup) - 1;
		for ($x = 0; $x < $length; ++$x) {
			$salt .= $soup[static::random_int(0, $max)];
		}

		return $salt;
	}