This doesn't come with an elaborate test suite, but it does pretty much everything that does in a few dozen lines of Perl.<p><a href="https://github.com/neilk/misc/blob/master/randline" rel="nofollow">https://github.com/neilk/misc/blob/master/randline</a><p>I've had this script (or versions of it) around for more than a decade. I didn't know the technique had a name.