password-generator icon indicating copy to clipboard operation
password-generator copied to clipboard

Cannot set my own special symbols

Open patrikvalentaa opened this issue 3 years ago • 1 comments

Hi, I cannot add my own symbols, is it possible someway? I tried to defined own option and parameter to it $generator ->setLength(25) ->setOptionValue(RequirementPasswordGenerator::OPTION_UPPER_CASE, true) ->setOptionValue(RequirementPasswordGenerator::OPTION_LOWER_CASE, true) ->setOptionValue(RequirementPasswordGenerator::OPTION_NUMBERS, true) ->setOption($symbols, array('type' => Option::TYPE_BOOLEAN, 'default' => false)) ->setParameter($symbols, '!@#$%^&*?_~-,.+') ->setOptionValue($symbols, true)

but i allways get Hackzilla\PasswordGenerator\Exception\InvalidOptionException. Is there some way to defined it? I need to generate password with specifical symbols. Thanks

patrikvalentaa avatar Aug 13 '21 09:08 patrikvalentaa

I'm not sure what @symbols contains, but you want to set it like this.

$generator->setParameter(self::PARAMETER_SYMBOLS, '!@$%^&*()<>,.?/[]{}-=_+')

You can find more information in #21

hackzilla avatar Aug 16 '21 15:08 hackzilla