Hi Perry,
You have got it about right. Although the details of the algorithms are
considered as confidential, the Basic equivalent of some of them was
published in the UniVerse internals course. Some simple experimentation
shows that the published version of the type 18 algorithm is actually not
quite right and a corrected version is shown below.
hashvalue = 0
bytes = len(@id)
for i = 1 to bytes
ch = @id[i,1]
hashvalue += hashvalue * 10 + seq(ch)
next i
group = mod(hashvalue, modulo) - 1
Your 8 character limit problem is almost certainly because in the real
implementation, the line that accumulates the hash value needs to ignore
overflow of the 32 bit integer that it works with. You could achieve this
with a BITAND() operation.
I actually have a copy of the real algorithms which we legally obtained as
part of a project that we undertook with full support from VMark in the
early 1990s but given that IBM now consider these confidential, I don't
think I can publish them. (Can you really retrospectively make something
secret?). I can, however, verify that the algorithm above, which is fairly
easy to deduce by experiment, is essentially correct.
Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
+44-(0)1604-709200
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/