A simple iterative library to obtain the next lexicographic permutations of a string in O(n) time, and all permutations in lexicographic order.