Added function to generate config string and its length.