gpt4 book ai didi

json - JSON 是否有类似 Checksum 的机制?

转载 作者:行者123 更新时间:2023-12-04 05:02:56 25 4
gpt4 key购买 nike

我需要将大量 JSON 数据上传到网络服务。分析服务器正确接收数据并上传所有数据的最佳方法是什么?请让我知道是否有人在这方面有任何经验。谢谢。

最佳答案

您可以查看我的项目:
https://github.com/hidayetcolkusu?tab=repositories

计算:

ChecksumCalculator checksumCalculator = new ChecksumCalculator();

string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU""}";

ushort checksum = checksumCalculator.Calculate(json);
Result: 43460

比较:
ChecksumCalculator checksumCalculator = new ChecksumCalculator();

string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU""}";

bool result = checksumCalculator.Compare(json, 43460);
Resut:true

或者
ChecksumCalculator checksumCalculator = new ChecksumCalculator();

string json = @"{""Name"":""Hidayet Raşit"",""Surname"":""ÇÖLKUŞU"",""Checksum"":43460}";

bool result = checksumCalculator.Compare(json);
Result:true

关于json - JSON 是否有类似 Checksum 的机制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15894070/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com