public static int[] next(String desc) {

		if (null == desc || desc.isEmpty()) {
			throw new IllegalArgumentException("the arg:desc can not be empty");
		}

		int len = desc.length();
		int[] prefix = new int[len];

		prefix[0] = 0;

		for (int i = 1; i <= len - 1; i++) {
			int k = prefix[i - 1];

			while (desc.charAt(i) != desc.charAt(k) && k != 0) {
				k = prefix[k - 1];
			}

			if (desc.charAt(i) == desc.charAt(k)) {
				prefix[i] = k + 1;
			} else {
				prefix[i] = 0;
			}
		}

		return prefix;
	}