473,395 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 17796
dim t as string. s as string
t="blah blah blah"
s=t.tohash
"Frank King" <fr********@hotmail.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********@hotmail.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.GetHashCode' 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********@hotmail.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.GetHashCode' 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********@hotmail.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********@hotmail.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********@hotmail.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.public.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
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....
3
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...
10
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...
6
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..)....
2
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
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...
44
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 =...
4
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....
9
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.