Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert a alpha string to a unique numerical value 2

Status
Not open for further replies.

MissyEd

IS-IT--Management
Feb 14, 2000
303
GB
Hi,

Just out of curiosity, I wondered how I could get the numerical value of a word. For example "Smith" Could be 512 an it would be unique unlike "Smithson". I could use soundex but it would be the same for Smith and smiths for example.

Life is a blast when you have a semi-automatic..
 
For starters, you'd need a HUGE integer for this--if you think about the permutations (26 chars if case-insensitive), to the power of the number of characters in the word.

I think I got the math right there, either way, it's significantly larger than long integer, and depending on the number of characters you allow, even the Currency integer data-type might not handle it.
--Jim
 
What formula are you using to get from "Smith" to 512?

--James
 
JamesLean - I was just giving an example, it wasnt a result of a calculation.

jsteph - I see what you mean! It was just a thought, as using the ASCII value on the string only returned the result of the conversion of the first character.



Life is a blast when you have a semi-automatic..
 
If you don't need absolute uniqueness - for example, to obtain hash values or "quick" control numbers - try CHECKSUM().

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Sounds good, thanks very much

Life is a blast when you have a semi-automatic..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top