added support for optional character limit

I was getting annoyed at the number of sites with a max character limit on passwords so...  Added an optional parameter that accepts a number (well, it accepts anything, but strips it down to digits only) and truncates it to the given number of characters.  If no numbers are given the full string is still returned