Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Registration Key
Message
From
23/05/2001 04:27:43
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/05/2001 01:12:10
Ashish Patel
Hindustan Petroleum
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00510203
Message ID:
00510221
Views:
22
>Hi
>
>I am developing a small package for local market in foxpro 2.6 for DOS and I want to build the registration facility in my package. So I will come to know
>how many guys are using my package.
>
>It should be like when they give Company's name in the registration screen it
>should also ask for the activation key which (when the user contacts me) they
>will enter after asking me. activation key should depend on Company's Name.
>I have written a small prog. which generates a unique key. Rightnow I am able
>to genrate only 8 character long activation key. I want to make this key long
>like other standard product.
>
>Can anyone help me in this regard ?
>
>Thanks in Advance
>
>Ashish

Ashish,
You could make a key as long as you want based on a string, random generated values etc. ie:
lcCompany='My Lovely Company Name'
lcCRC = padl(val(sys(2007,lcCompany)),5,'0')
lcKey = ''
for ix=1 to 5
 lcKey = lcKey + padl(ToBase36(val(substr(lcCRC,ix,1))^5),4,'0')
endfor
? lcKey

function ToBase36
lparameters tnNumber
local lnNumber
lcStr=''
do while tnNumber >= 36
  lnNumber = tnNumber % 36
  lcStr = iif(lnNumber<10, str(lnNumber,1), chr(asc('A')-10+lnNumber))+lcStr
  tnNumber = int(tnNumber / 36)
enddo
lcStr = iif(tnNumber<10, str(tnNumber,1), chr(asc('A')-10+tnNumber))+lcStr
return lcStr
Here a string's CRC value is extended to 4 chars per digit ending in 20 chars key. This is in a sense one way coding. You can't (you can but accept can't) get back lcCompany but you can compare the CRC value with the decoded value.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform