Raised This Month: $ Target: $400
 0% 

Protecting the Plugin Author Name


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
dutchmeat
Senior Member
Join Date: Sep 2006
Old 01-29-2007 , 08:16   Re: Protecting the Plugin Author Name
Reply With Quote #2

Code:
char alfabet[] = { 'a', 'b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char name[] = "dutchmeata";
int number = 0,a,j;
int strl = strlen( name ); //9 in this case.
for (a=0; a<30; a++) {
for (j = 0; j < 26; j++) {
if (name[a] == alfabet[j])
number += j;
}
}
if (number == 86 && strl == 9 ){
printf("Woohoo! we have a correct name\n");
}else{
printf("The name is incorrect.\n");
}
Explanation:
Every name has it's own number, for example amxx has the number '23' (a = 0, + a = 0 + x=23)
//new alfabet[][] = { "a","b","c","d","e","f","g","h","i","j","k"," l","m","n","o","p","q","r","s","t","u","v","w ","x","y","z"}
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
In this case the 'name number' is 86.
So if the 'name number' is correct, there's a second check to match the length of the name.
This is C++, and not small, but you can easily port it if you need it...
I hope someone find it useful.
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode