473,574 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String to String Hash function In VB

Hi,

I am looking for a hash function to map string to string
in VB. Could somebody give me some informtion?

Thank you very much.

fk
Nov 20 '05 #1
6 17804
dim t as string. s as string
t="blah blah blah"
s=t.tohash
"Frank King" <fr********@hot mail.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
Hi,

I am looking for a hash function to map string to string
in VB. Could somebody give me some informtion?

Thank you very much.

fk

Nov 20 '05 #2
"Frank King" <fr********@hot mail.com> scripsit:
I am looking for a hash function to map string to string
in VB. Could somebody give me some informtion?


You can use the 'String.GetHash Code' function to get a hash for a
string's. Maybe you should provide more information on what you want to
do with the hash...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Thank you for your post.

I have a list of string pairs. I use the first string
(in the pair) to find the second string. The second
string is in fact the value of the first string. If I use
an array, it will be very slow to find the value of a
given string. So, I am trying to use hash function to find
the value of a given string variable.
-----Original Message-----
"Frank King" <fr********@hot mail.com> scripsit:
I am looking for a hash function to map string to string
in VB. Could somebody give me some informtion?
You can use the 'String.GetHash Code' function to get a

hash for astring's. Maybe you should provide more information on what you want todo with the hash...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #4
"Frank King" <fr********@hot mail.com> schrieb:
I have a list of string pairs. I use the first string
(in the pair) to find the second string. The second
string is in fact the value of the first string. If I use
an array, it will be very slow to find the value of a
given string. So, I am trying to use hash function to find
the value of a given string variable.


Have a look at the 'Hashtable' class.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Thank you for the message. I realized that I forgot
to say that I am using VB 6.0. Especially I am using
VBA. Do you have an idea what I should use?

fk

-----Original Message-----
"Frank King" <fr********@hot mail.com> schrieb:
I have a list of string pairs. I use the first string
(in the pair) to find the second string. The second
string is in fact the value of the first string. If I use
an array, it will be very slow to find the value of a
given string. So, I am trying to use hash function to findthe value of a given string variable.


Have a look at the 'Hashtable' class.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
.

Nov 20 '05 #6
"Frank King" <fr********@hot mail.com> schrieb:
Thank you for the message. I realized that I forgot
to say that I am using VB 6.0. Especially I am using
VBA. Do you have an idea what I should use?


This is a VB.NET language group. You will more likely get an answer to your
question if you post it to one of the VB Classic groups
(microsoft.publ ic.vb.*)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #7

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

Similar topics

4
8879
by: Seth | last post by:
I want to create a simple hash function that can hash strings. Currently I'm storing passwords as strings in a DB but want to store them as a hash. I don't need any proper standardised hashing e.g. MD4 or MD5. I also want to be able to write the function completely using VB Script (therefore no components etc) I'm thinking along the lines...
3
3090
by: Stewart | last post by:
Dear javascripters, Through a frustrating afternoon of debugging I appear to have discovered something: Setting location.hash to an empty string in the global namespace (not inside a function) Mozilla/FireFox/Netscape causes the browser to go into an infinite loop, apparently attempting to reload the page. ie: <script...
10
18567
by: Mamuninfo | last post by:
Hello, Have any function in the DB2 database that can generate unique id for each string like oracle, mysql,sybase,sqlserver database. In mysql:- select md5(concat_ws("Row name")) from tablename; Here this function generate unique id for each row of the table. Regards..
6
2611
by: Ian Gibbons | last post by:
Firstly what type is %x as I've not encountered it before? Now the problem: I'm trying to alter a host masking system for ircd so that it masks all but the isp name and location (if .uk.us etc..). However the crc32 stuff doesnt return as a string, and because the number of hostname fields is not static I need to build a string which contains...
2
2583
by: huey_jiang | last post by:
Hi All, I need to make DLL for my new hash function in C. In myhashdll.c file, I have a function as: char *make_hash(char *in, char *out) { ...... ...... return (out);
4
13394
by: David Bargna | last post by:
Hi I have a problem, I have a string which needs to be converted to a byte array, then have the string representation of this array stored in an AD attribute. This string attribute then has to be read and the string representation of the byte array has to be converted back to the original byte array and converted back to the original string...
44
6680
by: gokkog | last post by:
Hi there, There's a classic hash function to hash strings, where MULT is defined as "31": //from programming pearls unsigned int hash(char *ptr) { unsigned int h = 0; unsigned char *p = ptr;
4
2371
by: simon | last post by:
hi, I would like to separate my javascript completely from my xhtml. in the end there should be only <script type="text/javascript" src="javalib.js"></script> in the head-tag to my javascript. Because I want to use some ajax-requests and other javascript-functions on my xhtml, I need to dynamically add event handlers to any possible...
9
5283
by: Adriano | last post by:
Hello, I have the following string headers: Header 1, 2, 3, 4: 1.00TJ123456PPC 00000000DLGLGN 00000001TXBEG Login:user=a, pswd=a"
0
7746
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8262
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...
1
7842
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...
0
6497
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5641
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...
0
5331
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...
0
3768
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...
1
2258
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1092
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.