简体   繁体   English

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

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

Lets say I got 2 unsigned integer 可以说我有2个无符号整数
first with value &H0D345B40 首先值为&H0D345B40
second with value &H9AF34A32 &H9AF34A32第二

How do I produce a unsigned 64 bit integer with the value &H324AF39A405B340D 如何生成值为&H324AF39A405B340D的无符号64位整数

Here is what I tried 这是我尝试过的

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

Solved it a crappy way but not bad anyways 解决了一个糟糕的方法,但无论如何都还不错

    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.

相关问题 如何使32位VB6应用程序适用于64位Office? - How can I adapt a 32-bit VB6 application to work with 64-bit Office? 将32位带符号整数转换为64位整数,同时保留确切的位 - Convert 32-bit signed integer to 64-bit integer while preserving the exact bits 如何以编程方式检测32位或64位visio版本? - How to programmatically detect 32-bit or 64-bit visio version is installed? 如何使用 32 位进程查找 64 位进程信息 - How to find 64-bit process info using a 32-bit process 如何使用VB 2005在64位上运行32位应用程序? - How to run 32-bit app on 64-bit using VB 2005? 如何在 64 位 vb.net windows 应用程序中引用 32 位 dll - How to reference a 32-bit dll in a 64-bit vb.net windows application CopyFromScreen可在32位Win10计算机上运行,​​但不能在64位计算机上运行 - CopyFromScreen works on 32-bit Win10 computer but not 64-bit 在32位和64位开发站上部署.Net应用程序源控制(SVN) - Deploying a .Net App Source Control (SVN) over 32-bit AND 64-bit dev stations 无法从64位托管代码调用32位非托管DLL - Unable to call 32-bit unmanaged DLL from 64-bit managed code 按位移位操作在VB.NET中提供的是32位结果而不是64位结果 - Bitwise shifting operation gives a 32-bit result instead of a 64-bit result in VB.NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM