That's not the code that was provided. See my reply below.
www.joomlapolis.com/forum/255-developer-members-support/239506-alter-the-generated-password?limitstart=0#306684
That trigger does not require hashing since the hashing happens after that trigger. Store also is not necessary as it will interrupt the registration process and store will happen after the trigger. You should only need to use the below for the code.
Code:
$variables['var1']->setRandomPassword( 6 );
$variables is just an array of variables sent by the trigger. var1 is the user object being registered for that trigger.
When testing enable debug mode and maximum error reporting in Joomla global configuration then also enable Debug within your auto action under Parameters. This should ensure if an error does happen it'll be displayed. If your server does not allow create_function or eval you won't be able to pass variables by reference.