Converting C# code to VB.NET

后端 未结 3 1442
暗喜
暗喜 2021-01-16 03:52

i tried converting this code from c#

a += (uint)(url[k + 0] + (url[k + 1] << 8) + (url[k + 2] << 16) + (url[k + 3] << 24));
3条回答
  •  误落风尘
    2021-01-16 04:15

    Your main problem seems to be that C# will allow bit-shifting on a char whereas VB does not.

    So you would need something like (untested)

     CUInt( ... + (CUint( url(k + 1) ) << 8) + ... )
    

    But it does look like a rather weak HashCode.

提交回复
热议问题