FOXCHKSUM 算法
谁知道这个函数如何计算校验和值?
我的目标是在.NET 上重写 FoxPro 应用程序,保留旧数据库,但数据库中的某些值是用此函数计算的。
问题已结束。
我没有注意到FOXCHKSUM已成为项目中的内部函数。
——
但是,无论如何,感谢您的提问!
Who knows how this function calculates checksum values?
My goal is to rewrite the FoxPro application on .NET, preserving the old database, but some values in the DB were calculated with this function.
Question is closed.
I didn't notice that FOXCHKSUM has been internal function in the project.
--
But, anyway, thanx for aswers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
FoxPro 校验和函数 SYS(2107) 和SYS(2007) 使用CRC16 或 CRC32 来计算校验和值。 FOXCHKSUM 函数是否可能包装这些?
The FoxPro checksum functions SYS(2107) and SYS(2007) use CRC16 or CRC32 to calculate the checksum values. Is it possible that the FOXCHKSUM function is wrapping these?
在 Foxpro 中,您可以使用使用 FOXCHKSUM 函数的方法创建一个类。
然后将其编译为 COM dll,然后在 .NET 代码中使用它。
In Foxpro You could make a class with a method wich utilizes the FOXCHKSUM function.
Then compile it into COM dll and then use it in your .NET code.
从它明显的声音来看,它试图计算一些校验和值......可能是记录级别,或特定的字段内容。我会查看原始的 VFP 代码,看看传递给函数调用的内容以获取结果。然后,我会研究一下也处理加密/校验和(例如 MD5)的 .Net 库。然后,您可以尝试使用相同的字符串调用标准 .net 函数,直到找到哪个函数给出相同的结果,然后您就不必处理 COM。我什至不知道 FoxChkSum 是 VFP 编码函数还是外部 .fll 或 .dll。如果是VFP代码,我也许可以帮你解密。
From the obvious sounds of it, its trying to calculate some check-sum value... maybe record level, or specific field content. I would look in the original VFP code to see what is being passed to the function call to get the results back. Then, I would look into the .Net libraries that also deal with encryption / checksums such as MD5 as a simple one. Then, you can try calling a standard .net function with the same string until you find out which one gives you the same results, then you don't have to deal with COM. I don't even know if FoxChkSum is a VFP coded function or an external .fll or .dll. If its VFP code, I can probably help out decyphering it for you.
如果有人感兴趣 - 我发现 Foxpro 算法使用函数 SYS(2107) 和 SYS(2007) 计算 Crc16 和 Crc32。 (参见@Stuart DunkeId 的回答)。
它并不是真正的CRC,而是一些校验和计算。无论如何,该函数返回与 FoxPro 模拟相同的结果。
这是 C# 上的:
If is it interested to somebody - I found Foxpro algorithm that calc Crc16 and Crc32 with functions SYS(2107) and SYS(2007). (See answer of @Stuart DunkeId).
It is not really CRC, but some checksum calculation. Anyway that function return just the same result that foxpro analog.
Here is it on C#:
在 Visual FoxPro 中测试稍微更新的算法(我懒得安装 C#): CRC16 运行良好,但 CRC32 给出了不同的结果......
Testing slightly updated algorithm in Visual FoxPro (I am lazy to install C#): The CRC16 works well but CRC32 gives different results...