Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Registration key

Posted on 1997-05-29
2
Medium Priority
?
253 Views
Last Modified: 2010-04-16
I am trying to find algorytms to create a Registration
Key system but am having trouble locating this.
Any ideas would be gretly appreciated even the simple ones.
0
Comment
Question by:fatman052997
2 Comments
 
LVL 3

Expert Comment

by:moonlight
ID: 1215343
Don't exactly know what you are looking for,
a search algorithm like binary search,
or keys for dividing data in divided parts,
e.g. the alphabet, if so, what are you trying
to register? and what are the desired function?
(like equally divided..etc)
0
 
LVL 1

Accepted Solution

by:
mrosen earned 300 total points
ID: 1215344
A registration algorithm is pretty easy. Here's a good one (it's a sample):

Generate a random four digit number:
randum := random(10000);
then make it into a string:
str(randnum,randstring);

those first four digits are the first part of the registration key
regstring = randstring;

the remaining digits will be calculated by doing stuff to the digits of that number.
for example, try this

regstring  = regstring + chr(randnum div 30);
regstring  = regstring + chr(randnum div 27);
regstring  = regstring + chr(randnum mod 19);

do this until you have enough digits (I do it like six times)

To check the validity of the registration code in your program, you can do this:

you know the random number, because it's the first four digits of the registration string the user enters in. val it and move it to a variable rannum. Then, check

if (regstring[5] != chr(randnum/30)) then
     it's not registered, so set a variable or something
... do this for each digit.

See. It's pretty cool. If you have any more questions, or want to base the registration number on the name of the customer or something like that, feel free to e-mail me at mrosen@peganet.com.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Loops Section Overview
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question