Compute string permutations.