473,796 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a unique number from a text string

I am trying to create a registration system in which a unique text string
accessible in a table of the program is turned into a unique number which
will be matched with a number sent to the customer to type into the program
to reregister it. The idea is that this key will not work on another
program, only the one it is generated for.

My initial problem is how do I generate in code, a unique number from say a
3 word phrase with only letters of the alphabet in it.

dixie
Nov 13 '05 #1
3 8263
On Wed, 26 Oct 2005 10:35:36 +1000, "Dixie" <di***@dogmail. com> wrote:

There are many ways. For example you could turn each character's ASCII
code into a hex number:
A -> Hex$(Asc("A")) = 41
etc.
You can also look at something called Base-64, which was specifically
designed to turn any string into "easy" characters.

-Tom.

I am trying to create a registration system in which a unique text string
accessible in a table of the program is turned into a unique number which
will be matched with a number sent to the customer to type into the program
to reregister it. The idea is that this key will not work on another
program, only the one it is generated for.

My initial problem is how do I generate in code, a unique number from say a
3 word phrase with only letters of the alphabet in it.

dixie


Nov 13 '05 #2
Thanks Tom. I have done something with Base64 by using one of the free
online sites to encode the text into base64 and then copied the encoded text
into the program for a particular site. I have figured out how to do the
rest of the stuff I need to do to re-register the software. The one
improvement that would be really good is to have a module which could do the
base64 encoding itself within Access. Does anyone know of any such module
or another way of doing this?

dixie

"Tom van Stiphout" <no************ *@cox.net> wrote in message
news:2c******** *************** *********@4ax.c om...
On Wed, 26 Oct 2005 10:35:36 +1000, "Dixie" <di***@dogmail. com> wrote:

There are many ways. For example you could turn each character's ASCII
code into a hex number:
A -> Hex$(Asc("A")) = 41
etc.
You can also look at something called Base-64, which was specifically
designed to turn any string into "easy" characters.

-Tom.

I am trying to create a registration system in which a unique text string
accessible in a table of the program is turned into a unique number which
will be matched with a number sent to the customer to type into the
program
to reregister it. The idea is that this key will not work on another
program, only the one it is generated for.

My initial problem is how do I generate in code, a unique number from say
a
3 word phrase with only letters of the alphabet in it.

dixie

Nov 13 '05 #3
In VBA numbers are limited in size by the number of bytes used to store
them in memory. Unless on messes with variant decimals, 8 bytes seems
to be the maximum.
So it will be hard to represent a string of 47 bytes with a number
which can deal with only 8.
If you would like a number based on the first 8 bytes of the string, or
you would like to require an 8 character password/login then this
function (cobbled together over coffee and subject therefore to the
appelation, "Air Code") might help. I have used currency because it is
stored as 8 bytes and because it is simple, usually being displayed in
#.# and not scientific notation.

Option Explicit
Private Declare Sub CopyMemory _
Lib "kernel32" Alias "RtlMoveMem ory" _
(Destination As Any, Source As Any, ByVal Length As Long)

Function CurrencyFromStr ing(ByVal s As String) As Currency
s = s & String(8, vbNullChar)
s = Left(s, 8)
Dim a() As Byte
a = StrConv(s, vbFromUnicode)
CopyMemory CurrencyFromStr ing, a(0), 8
End Function

Sub text()
Debug.Print CurrencyFromStr ing("Dixie")
End Sub

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5972
by: Iain Miller | last post by:
Now this shouldn't be hard but I've been struggling on the best way as to how to do this one for a day or 3 so I thought I'd ask the assembled company..... I'm writing an application that tracks a group of Sales people, the customers they deal with and the business they transact with them. I've got my head around all the tables & some of the basic Query structures OK and am beginning to delve into creating the forms I need to be able...
6
7645
by: F-13 | last post by:
I'm working on a BOM in Access 200 from an example downloaded from from the web. The sample database contains three tables, Assemblies (the list of items needed to assemble any assembly), Components (the list of items recognised by the Assemblies Table)and Output (a table used to display the BOM from a chosen assembly). It works fine but there are no forms. For a user to edit or create a BOM, should there be a form for each assembly of...
0
1078
by: Mark Broadbent | last post by:
can someone help me? After creating an xml schema file in VS 2003, I drag and drop a table onto it to create its schema. However what I am getting is a document element encapsulating the actual table definition. This is not exactly what I expect or how it should happen according to text that I am reading. Anyone tell me what if anything I am doing wrong? See XML sample below. <xs:element name="Document1" msdata:Locale="en-GB"> ...
0
1291
by: Mark Broadbent | last post by:
(firstly sorry Ive cross posted this in C# forum also -I forgot to include this ng) can someone help me? After creating an xml schema file in VS 2003, I drag and drop a table onto it to create its schema. However what I am getting is a document element encapsulating the actual table definition. This is not exactly what I expect or how it should happen according to text that I am reading. Anyone tell me what if anything I am doing wrong?...
4
6832
by: RCS | last post by:
We have sort of a centralized single-signon written in ASP.NET for all of our legacy ASP and ASP.NET apps.. There are around 1200 users and something like 2 dozen apps. Everyonce in a while, a user gets the error that their session is a duplicate in the database.. I talked to the database guys about putting in a job that cleans up old sessions, but I also want to have this work a little cleaner on the front-end. I need to generate a...
3
2069
by: triplejump24 | last post by:
i LOVE doing c++ programming, but i never can get myself started! Once i figure it out, its fun but anyways here it goes... Im given a file c:\temp\hwk8input.txt, which contains the records of the video collection of a small local library. There are four fields for each video: 1) A unique video ID number without space (v1, v2, etc.); 2) The full video title; 3) The availability of the video (0 for checked out and 1 for checked in); 4) A...
8
7210
by: Marc | last post by:
Hi all, I have to generate and send to a printer many 6 digit alphanumeric strings. they have to be unique but I cannot check in a database or something like that if it have already been printed. the string has also to seem a random one and it cannot have an apparence of a sequence. My first approach is to do it with a decimal counter and find and use an encryption alghorithm that converts each 6 digit decimal number to a 6 digit...
3
1721
by: deaddog4201 | last post by:
How can i save a .txt file where the name of the file would be the result of the selection made from a Dom tree view's parent node tag in visual basic? So for example i have an editable tree view form i add an entry to the tree view when i save it another process is started "part of which is an encryption scheme" the important part i need help with is saving the sharedkey as the value of the elements parent tag applied to a new addition to the...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.