Converting C# code to VB.NET

后端 未结 3 628
再見小時候
再見小時候 2021-01-16 03:32

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:20

    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.

提交回复
热议问题