public RabinKarp(String pattern) {
		this.pattern = pattern;
		
		R = 25;
		M = pattern.length();
		Q = longRandomPrime();
		
		// pre-compute R^(M-1) % Q for use in removing leading digit
		RM = 1;
		for (int i = 1; i <= M-1; i++)
			RM = (RM * R) % Q;
		
		patternHash = hash(pattern, M);
	}