6 kyu

Password generator

719 of 1,440user7657844
Description
Loading description...
Regular Expressions
Security
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ScootRoosE Avatar

    Not sure where my previous comment went. But I was able to successfully solve in JavaScript. Wasn't a kata issue. I wasn't meeting the validity requirements of having AT LEAST one of lowercase letter, one uppercase, and one number. I simply overlooked the lowercase requirement...

  • Pomelo57 Avatar

    Hello, when I run my code through VS code it works. But when I test it on here I get this error message:

    Traceback (most recent call last): File "/workspace/default/tests.py", line 9, in lower = any(c.islower() for c in pwd) ^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not iterable

    Please can someone help me?

  • natan Avatar

    JS tests print AFTER assertion

    assertion fails -> exception -> print never happens because exception exited the function early -> no information given to solver what's wrong

    the python tests are also written this way but that test framework doesn't exit early on failed assertion (it should though, and it could conceivably change that behaviour)

  • ScootRoosE Avatar

    in JavaScript:

    Passing all 4 tests(10k passwords generated, testing lengths, testing inequality, testing character count) proceeded by 1 fail saying: "Invalid passwords generated!: expected false to be true"

    Is there something I'm missing here?

  • TheLoneCub Avatar

    This comment has been hidden.

  • ejini战神 Avatar

    Crystal's tests do not check for randomness, also needs a lot of clean-up

  • dfhwze Avatar

    Unsolvable in Crystal

  • NoahNonOff Avatar

    Very cool kata, to train about random function ! That's pretty fun (i've done it in js)

  • Bunkierski Avatar

    Solved, but I'm curious why I can't use console.log() in JS?

  • eurydice5717 Avatar

    This comment has been hidden.

  • ashot_codewars Avatar

    <C++> I think there is some problem in this kata. After Submiting my code I decided to remove the "cout" sections in my code and noticed that it started to not working after that.

  • farhanaditya Avatar

    Thanks for the kata! Now I have my own password generator :)

  • user9644768 Avatar

    Ruby 3.0 should be enabled.

  • ejini战神 Avatar

    Crystal final test cases are broken for unknown reason.

  • fenring76 Avatar

    This comment has been hidden.

  • acm1812 Avatar

    My code fails one of the final test cases. It says that the password generated is invalid, even though it meets all the criteria in the test cases. I am using python.

  • FabianR Avatar

    Testing for password lengths ... Passwords lengths are not different enough! (6-20 chars)

    What?

  • anter69 Avatar

    Ruby checker function is broken: it doesn't check correctly if all passwords contain at least one character from each group.

  • bitgex Avatar

    Maybe this question can't be answered because it's too revealing, but I must ask anyway.

    Coding in C++, using built-in random function and seeding with time. However, when the tests run, it gives the same password every single time. The password looks random, but it is just the same thing over and over again. Not really sure how to get around this because seeding with the time should solve this problem. Any tips?

  • Hackjaku Avatar

    Same issue here. Everything seems fine in log but I can't pass the bias test. I guess it has something to do with the 50% occurrence limit total. I'm using rand() in C++ to generate random integers to convert to chars, maybe there is a better randomic engine out there?

  • erichlf Avatar

    I have used the standard fix for modulo bias and I still can't get this thing to pass the bias test.

  • zbcoder Avatar

    what problem? Completed in 419ms Testing validity ... Test Passed Completed in 1ms Testing for password lengths ... Test Passed Testing for inequality ... Test Passed Testing for character count ... ✘ Passwords use a limited characterset!

  • dshvets1 Avatar

    I cannot pass "passwords without bias" either. When I am running the code in the terminal, everything looks just fine. For example:

    8X35cQ WI5Vf8PDmigB 5mogMnbcCSKeOclGWtb5 0hZilZyFHkB 6S3K299gGma2l3x1 Zgr43aXQ PYfKIe5b guTNEpt8fdQZ3gTi z6wMVvd6QESUGfz0yD VgJEI97ZuCOPgOkkBL0

    Does anyone have an idea what exactly this test check?

  • codebro1 Avatar

    How to pass the "passwords without bias" test? What is it testing for?

  • nimou Avatar

    C++ I'm struggling with this one!

    Still can't pass the "should_generate_passwords_without_bias" tests. I'm pretty sure I'm respecting all criterias.

    Anyone else having problems in C++ ? I can see that 6 people passed the test, so it has to be me, but still.. :/

    Also could you clarify "...all characters should have less than 50% occurance..." What does that mean exaclty ?

    Thanks for the help !

  • mythknight Avatar

    I found this kata more difficult in javascript as compire to Python !!! Great kata

  • mshirman Avatar

    I also have 1 test case failing "Passwords lengths are not different enough! (6-20 chars)". I'm not sure what's wrong. Please let me know...

    Test Results: Generating 10000 passwords ... Testing validity ... ✔ Test Passed Testing for password lengths ... ✘ Passwords lengths are not different enough! (6-20 chars) Testing for inequality ... ✔ Test Passed Testing for character count ... ✔ Test Passed

  • GiacomoSorbi Avatar

    JS, Ruby and Crystal translations kumited :)

  • nstotsky Avatar

    what i do wrong? Generating 10000 passwords ... Testing validity ... ✔ Test Passed Testing for password lengths ... ✘ Passwords lengths are not different enough! (8-20 chars) Testing for inequality ... ✔ Test Passed Testing for character count ... ✔ Test Passed

  • bsiverly Avatar

    Any idea what "Passwords use a limited characterset!" can be fixed by? My code passes all the other tests. I thought we were supposed to use a limited character set, (uppercase, lowercase, and numbers only, as per instructions)

  • anter69 Avatar

    I updated the test cases and added an example test case to help the users. I hope I did it right (this is my first kata contribution :-) The final tests should be much more strict now.

    Check and let me know if you like it!

  • anter69 Avatar

    This comment has been hidden.

  • anter69 Avatar

    This comment has been hidden.