繁体   English   中英

如何将2个32位无符号整数合并为64位整数

[英]How do I combine 2 32-bit Unsigned Integers to 64-bit integer

可以说我有2个无符号整数
首先值为&H0D345B40
&H9AF34A32第二

如何生成值为&H324AF39A405B340D的无符号64位整数

这是我尝试过的

dim crypt1 as uint32 = &H0D345B40
dim crypt2 as uint32 = &H9AF34A32

Dim output As UInt64 = (CType(CType(crypt1, UInt64), Long) Or (crypt2 << 32))

the output is &H000000009FF75B72

解决了一个糟糕的方法,但无论如何都还不错

    dim output() as uint64
    Dim bytes() As UInteger = {crypt1, crypt2}

    Buffer.BlockCopy(bytes, 0, output, 0, 8)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM