Bob Jenkins perfect hash function in VB.Net

I am trying to convert Bob Jenkins perfect hash function from C # to VB.Net, and I am stuck in the following.

a += (UInt32)(url[k + 0] + (url[k + 1] << 8) + (url[k + 2] << 16) + (url[k + 3] << 24))

How can I write the instructions above in VB.Net?

Please note the following:

a - UInt32
url - String
k - integer

I tried the following, but it does not work.

a += url(k + 0) + (url(k + 1) << 8) + (url(k + 2) << 16) + (url(k + 3) << 24)

To avoid manual casting, I use "Option Strict Off"

0
source share
2 answers

Ok, I got a response from this page. See Henk Holterman's answer and MarkJ comments.

Convert C # code to VB.NET

0
source

, vb typecasting string integer ( char).
Val(Mid(url,k,1)) char .

0

All Articles