| 1 2 | $this->load->helper('string'); echo random_string('alnum', 16); | 
The first parameter specifies the type of string, the second parameter specifies the length. The following choices are available: alpha, alunum, numeric, nozero, unique, md5, encrypt and sha1