C
C#8mo ago
vibing subs

I need help with fourms

I made a project to do a password checker and generator. i done most of it. But i am struggling how to make the password checker check if it uses the qwerty format. and to make a score by it.
No description
43 Replies
HtmlCompiler
HtmlCompiler8mo ago
what would be the problem qwerty is literally qwertyuiop asdfghjkl zxcvbnm so you have to compare that with the password
Pobiega
Pobiega8mo ago
my approach would be to use a sliding window over the password, length 3, then for each window, check if the window exists in either of the three qwerty-strings
vibing subs
vibing subsOP8mo ago
I dont understand how to check if it contains that or not
Pobiega
Pobiega8mo ago
check my message just above yours
vibing subs
vibing subsOP8mo ago
how do i do that
Pobiega
Pobiega8mo ago
Do you know what a sliding window is?
vibing subs
vibing subsOP8mo ago
no all of this is confusing me too much. I am new to fourms i watched a tutorial video. its not helping that much i cant lie.
Pobiega
Pobiega8mo ago
This has nothing to do with forms
vibing subs
vibing subsOP8mo ago
Oh i need this in fourms. I did it in console first.
Pobiega
Pobiega8mo ago
Sure, but as said, it's not relevant
vibing subs
vibing subsOP8mo ago
but i didnt know i had to fo it in forms Ok @Pobiega what is sliding window never heard of it
Pobiega
Pobiega8mo ago
A sliding window in coding is a restricted view of a larger something Let's say the password is abcde We want to look if ABC, BCD or CDE is in your "bad" sequences It's a "window" of length 3 that "slides" over the total
vibing subs
vibing subsOP8mo ago
oh will it check for both capital and normal letters or do i have to do it differently for both.
Pobiega
Pobiega8mo ago
It won't do anything, it's something you will have to code. But you can easily normalize it so it's case insensitive
vibing subs
vibing subsOP8mo ago
I dont understand how it helps tho. or how i code it
Pobiega
Pobiega8mo ago
Well you need to know if there are any sequence of three characters in the password that is directly from the qwerty layout Can you really not see how a sliding window would help with that?
vibing subs
vibing subsOP8mo ago
no I am still clueless.
Pobiega
Pobiega8mo ago
Well, it's unfortunate you didn't answer earlier, cause I'm just about to head to bed
vibing subs
vibing subsOP8mo ago
Could you help me tmr?
Pobiega
Pobiega8mo ago
But try to think of a way to do this by hand
vibing subs
vibing subsOP8mo ago
perhaps
Pobiega
Pobiega8mo ago
Maybe?
vibing subs
vibing subsOP8mo ago
ok sleep well
Pobiega
Pobiega8mo ago
Step one is to figure out the problem. Step two is to come up with a solution. Step three is translating that solution into code.
vibing subs
vibing subsOP8mo ago
Ok
Pobiega
Pobiega8mo ago
No description
Pobiega
Pobiega8mo ago
This is a "sliding window" over a string. The window length is 3. so for this string, we'd get 3 results back. for each of these results, we test if that 3-length string exists in any of the known qwerty strings you'd then do something like...
var password = "hellofghjhello"; // get this from the form

foreach (var window in password.Window(3)) // Window is a custom extension method
{
if (IsSequenceFromQwerty(window))
{
// You would probably just increment a count here and return the count, or do the score caluclations directly
Console.WriteLine($"Found sequence: {window}");
}
}

// this is the signature of the extension method
static IEnumerable<string> Window(this string source, int size)
var password = "hellofghjhello"; // get this from the form

foreach (var window in password.Window(3)) // Window is a custom extension method
{
if (IsSequenceFromQwerty(window))
{
// You would probably just increment a count here and return the count, or do the score caluclations directly
Console.WriteLine($"Found sequence: {window}");
}
}

// this is the signature of the extension method
static IEnumerable<string> Window(this string source, int size)
how to implement the Window and IsSequenceFromQwerty methods is up to you.
vibing subs
vibing subsOP8mo ago
Oh
Pobiega
Pobiega8mo ago
do you get the idea?
vibing subs
vibing subsOP8mo ago
kind of So i use the sliding window to make sure if there is qwerty or not. but in order to use it i have to download it. right from extensions
Pobiega
Pobiega8mo ago
.. download it? what no you write it
vibing subs
vibing subsOP8mo ago
oh
Pobiega
Pobiega8mo ago
its just a simple method.
vibing subs
vibing subsOP8mo ago
ok
Pobiega
Pobiega8mo ago
also, eh.. you use it as part of your solution, specifically the "any sequence of length 3" part
vibing subs
vibing subsOP8mo ago
oh ok
Pobiega
Pobiega8mo ago
the sliding window itself doesnt know or care about qwerty
vibing subs
vibing subsOP8mo ago
So i have to add the qwerty part.
Pobiega
Pobiega8mo ago
Did you read the snippet I sent? and the messages around it? ...
MODiX
MODiX8mo ago
Pobiega
how to implement the Window and IsSequenceFromQwerty methods is up to you.
Quoted by
<@105026391237480448> from #I need help with fourms (click here)
React with ❌ to remove this embed.
vibing subs
vibing subsOP8mo ago
yea
Pobiega
Pobiega8mo ago
You have to implement the two methods that don't exist in that snippet of code Window might be a little tricky, but it's also a fairly common thing so should be googlable The qwerty one should be pretty easy
vibing subs
vibing subsOP8mo ago
aight i do that
Want results from more Discord servers?
Add your server