Varint+ZigZag解码 ZigZag编码

上传者: 32718727 | 上传时间: 2021-05-13 16:06:46 | 文件大小: 609KB | 文件类型: RAR
实现Varint + ZigZag的编解码过程,里面有我自己对Vint编解码实现的算法 ,VInt编码为Varint编码和ZigZag编码的结合,为一种将64位二进制编码的有符号整型编码在最多10字节中的编码方式。Varint编码为一种将64位二进制编码的无符号整型根据其大小用不同长度字节进行编码的编码方式。其编码特点为数字越小所占用的字节数越少。每个字节的低7位用来表示数字,最高位有特殊的含义:如果该位为 1,表示后续的一个字节也是该数字的一部分;如果该位为 0,则该字节为该数字的最后一个字节。因此小于 128 的数字都可以用一个字节表示。大于 128 的数字,会用两个或两个以上的字节编码。ZigZag编码是为了配合Varint来使用的一种为有符号整型数定义的编码。ZigZag的原理是按照绝对值大小来重新解析二进制。VInt的编码实际上是将64位整数的有符号编码首先使用ZigZag转换后,再用Varint进行的编码。VInt的编码与Google Protocol Buffer中wire type中的sint64的编码相同。

文件下载

资源详情

[{"title":"( 17 个子文件 609KB ) Varint+ZigZag解码 ZigZag编码","children":[{"title":"VintCode","children":[{"title":"VintCode.ncb <span style='color:#111;'> 49.00KB </span>","children":null,"spread":false},{"title":"VintCode.cpp <span style='color:#111;'> 4.34KB </span>","children":null,"spread":false},{"title":"VintCode.positions <span style='color:#111;'> 163B </span>","children":null,"spread":false},{"title":"VintCode.dsp <span style='color:#111;'> 4.33KB </span>","children":null,"spread":false},{"title":"VintCode.dsw <span style='color:#111;'> 539B </span>","children":null,"spread":false},{"title":"main.cpp <span style='color:#111;'> 293B </span>","children":null,"spread":false},{"title":"VintCode.h <span style='color:#111;'> 533B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"VintCode.obj <span style='color:#111;'> 16.71KB </span>","children":null,"spread":false},{"title":"VintCode.pdb <span style='color:#111;'> 681.00KB </span>","children":null,"spread":false},{"title":"vc60.idb <span style='color:#111;'> 81.00KB </span>","children":null,"spread":false},{"title":"main.obj <span style='color:#111;'> 11.99KB </span>","children":null,"spread":false},{"title":"VintCode.exe <span style='color:#111;'> 240.05KB </span>","children":null,"spread":false},{"title":"vc60.pdb <span style='color:#111;'> 100.00KB </span>","children":null,"spread":false},{"title":"VintCode.ilk <span style='color:#111;'> 355.50KB </span>","children":null,"spread":false},{"title":"VintCode.pch <span style='color:#111;'> 2.00MB </span>","children":null,"spread":false}],"spread":true},{"title":"VintCode.plg <span style='color:#111;'> 1.90KB </span>","children":null,"spread":false},{"title":"VintCode.opt <span style='color:#111;'> 48.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明