code: function createNewHash(plainPassword, onNewPassword) {
  	setImmediate(function () {
  		var pw = plainPassword;
  		var newSalt;
  		var newPasswordForMySQL;
  		var newHash;
  		try {
  			newSalt = crypto.randomBytes(saltLen).toString('base64');
  			newHash = pbkdf2.pbkdf2Sync(pw, newSalt, iterations, keyLen, algorithm).toString('base64');
  			newPasswordForMySQL = tag + separator + algorithm + separator + iterations + separator + newSalt + separator + newHash;
  		} catch (err) {
  			console.log('Not enough entropy to generate random salt');
  			newSalt = 'NewDefaultSalt16';
  			newHash = pbkdf2.pbkdf2Sync(pw, newSalt, iterations, keyLen, algorithm).toString('base64');
  			newPasswordForMySQL = tag + separator + algorithm + separator + iterations + separator + newSalt + separator + newHash;
  		} finally {
  			localEventEmitter.emit('newPasswordGenerated', newPasswordForMySQL, onNewPassword);
  		}
  	});
  }
docs: ================================================================
  This function is a callback that is launched when a
  'passwordCreationStarted' event is triggered. Creates a new
  PBKDF2 password using the values specified as parameters. It
  runs asynchronously and uses the format required by
  mosquitto-auth-plug. On success, it emits a
  'newPasswordGenerated' event to notify other functions.
  @description Creates a new PBKDF2 asynchronously following the
  format required by mosquitto-auth-plug.
  @param plainPassword The plain password for the specified
  username.
  @param onNewPassword Callback function to be called once the new
  password generation has finished. It is passed in to the next
  callback until it is necessary.
  @author Manuel Domínguez-Dorado <manuel.dominguez@enzinatec.com>
  @since 1.0
  ================================================================