Beta

Mnemo Passwords : pwgen

Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • JohanWiltink Avatar

    WTF is "an heartbleed proof" ?!?

  • HerrWert Avatar

    Fun kata, but I would add my voice to those calling for a better explanation of that vowel-count index. As a native (American) English speaker, my suggestion would be something like:

    Count the vowels in the service name, subtract one from this vowel count, then take the character from this index position in the service name. (Take the first character if there are no vowels.)

    Having said that, I must once again commend everyone who communicates so well in English here on Codewars despite not having English as their native language. Coming from a culture that shows far too little respect for foreign languages and foreign cultures, I am very impressed every day here on CW.

  • donaldsebleung Avatar
    1. Needs random test cases
    2. I feel that the description could be a bit clearer as to what is meant by "index number of vowels", for example
  • pre Avatar

    Would greatly benefit from wthit56's advice about clarifying the 1-based vowel system.

  • RachelBLondon Avatar

    This comment has been hidden.

  • MMMAAANNN Avatar

    I have added CoffeeScript translation. Please approve.

    In my translation, I have also added some randomized testing. As this is CoffeeScript, you can easily auto-translate it and add to JS as well (use coffeescript.org for automated translation, for example).

  • user2713389 Avatar

    Specify in the requirements what word is being parsed (e.g. 'Character in service name at index...', or 'The number of non vowels characters in the service name')

  • jainsneha23 Avatar

    1-based thing is confusing. More explanation is required.

  • ialpert Avatar

    1-based is not obvious enough

  • wthit56 Avatar

    The whole 1-based thing is just really confusing. You could just say that if there are zero or one vowels, the first character should be used, if there are three vowels, the third character should be used, that kind of thing. The coder should be incharge of making sense of that in the code, and one-based just confuses the matter.

    Nice and simple exercise, though. I would add some random tests too, but nice kata.

  • emptyflask Avatar

    I know it's just a kata, but something like this would make a much better password generator for use in the real world:

    def pwgen(base, sitename, length=12)
      salt = "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33" # must be kept secret
      Digest::SHA1.base64digest(base+sitename+salt)[1..length]
    end
    
    pwgen('secret', 'codewars') #=> "X+zJ2Kz2E6DY"
    pwgen('secret', 'facebook') #=> "6IH/OuqJrHl+"
    
  • OverZealous Avatar

    You need to clarify what to do when there are no vowels in the input string.

  • hencethus Avatar

    Kata description should specify that

    Character at index number of vowels.

    means 1-based indexing, unless there are no vowels, in which case use 0-based indexing.