Port of stringgen.js from the ROT.js package. Work in progress.