Chunker 内容定义组块实现开源项目

我要开发同款
匿名用户2016年12月18日
33阅读
所属分类Google Go、程序开发、其他开发相关
授权协议BSD

作品详情

Chunker是基于滚动RabinHash实现内容定义组块(CDC)。 

CDC算法是一种变长分块算法,它应用数据指纹(如Rabin指纹)将文件分割成长度大小不等的分块策略。与定长分块算法不同,它是基于文件内容进行数据块切分的,因此数据块大小是可变化的。

packagechunker

import"github.com/restic/chunker"

对于以十六进制系数表示法对指定的多项式列表进行过滤,可以使用以下脚本:

# create x over F_2 = GF(2)x := Indeterminate(GF(2), "x");# test if polynomial is irreducible, i.e. the number of factors is oneIrredPoly := function (poly)return (Length(Factors(poly)) = 1);end;;# create a polynomial in x from the hexadecimal representation of the# coefficientsHex2Poly := function (s)return ValuePol(CoefficientsQadic(IntHexString(s), 2), x);end;;# list of candidates, in hexcandidates := [ "3DA3358B4DC173" ];# create real polynomialsL := List(candidates, Hex2Poly);# filter and display the list of irreducible polynomials contained in LDisplay(Filtered(L, x -> (IrredPoly(x))));
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论