Given a string of different characters, and a number n, generate all the ordered combinations with repetition, of length 1 to n, using those characters.
Another way to define it is to see the given characters as "custom" digits in the base (radix) of the number of characters, then the program should generate all the "numbers" with 1 to n digits in that base, however, leading "zeros" are included too.
The combinations should be ordered by their length (1 character first, then 2, etc), but other than that they can be in any order. You can choose the most convenient ways of handling input and output. Shortest code wins.
Examples:
ab, 3
-> a,b,aa,ab,ba,bb,aaa,aab,aba,baa,abb,bab,bba,bbb
0123456789, 2
-> 0,1,2,3,4,5,6,7,8,9,00,01,...,09,10,11,...,99