diff --git a/Cargo.toml b/Cargo.toml index 9319c6b..aa56547 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ twox-hash = {version="1.6.3", default-features = false} mem_dbg = {version = "0.2.4", optional = true} hyperloglog-derive = { path = "hyperloglog-derive" } + [build-dependencies] serde_json = "1.0" diff --git a/optimal-gap-codes/Cargo.toml b/optimal-gap-codes/Cargo.toml index 75c7b07..05bbcbe 100644 --- a/optimal-gap-codes/Cargo.toml +++ b/optimal-gap-codes/Cargo.toml @@ -12,4 +12,8 @@ serde = { version = "1.0.208", features = ["derive"] } test_utils = {path="../test_utils"} twox-hash = "1.6.3" wyhash = "0.5.0" -dsi-bitstream = {git="https://github.com/LucaCappelletti94/dsi-bitstream-rs.git", branch="main"} \ No newline at end of file +dsi-bitstream = {git="https://github.com/LucaCappelletti94/dsi-bitstream-rs.git", branch="main"} +syn = "2.0" +quote = "1.0" +proc-macro2 = "1.0" +prettyplease = "0.2" \ No newline at end of file diff --git a/optimal-gap-codes/optimal-gap-codes.csv b/optimal-gap-codes/optimal-gap-codes.csv index 19768fe..332b7bc 100644 --- a/optimal-gap-codes/optimal-gap-codes.csv +++ b/optimal-gap-codes/optimal-gap-codes.csv @@ -1,110 +1,621 @@ -precision,bit_size,hash_size,hasher,composite_hash,code,space_usage,uncompressed_space_usage,rate,mean_gap_size -4,4,8,XxHash64,SwitchHash,Golomb(27),4470530,5600008,0.7983077881317312,6.386471428571428 -4,4,16,XxHash64,SwitchHash,Rice(13),2272226,2400544,0.9465462828425557,15.144841468210327 -4,4,32,XxHash64,SwitchHash,Rice(30),1593922,1600032,0.9961813263734726,31.87844 -4,5,16,XxHash64,SwitchHash,Rice(12),10024386,11200016,0.8950331856668776,14.320551428571429 -4,5,24,XxHash64,SwitchHash,Rice(21),4577074,4800024,0.9535523155717555,22.88537 -4,5,32,XxHash64,SwitchHash,Rice(29),4671674,4800032,0.9732589282738116,31.144493333333333 -4,6,16,XxHash64,SwitchHash,Rice(12),10024362,11200016,0.895031042812796,14.320517142857144 -4,6,24,XxHash64,SwitchHash,Rice(21),4577072,4800024,0.9535518989071722,22.88536 -4,6,32,XxHash64,SwitchHash,Rice(29),4671672,4800032,0.9732585116099226,31.14448 -5,4,16,XxHash64,SwitchHash,Rice(12),10023964,11200016,0.8949955071492754,14.319948571428572 -5,4,24,XxHash64,SwitchHash,Rice(21),4576980,4800024,0.9535327323363383,22.8849 -5,4,32,XxHash64,SwitchHash,Rice(29),4671180,4800032,0.9731560122932513,31.1412 -5,5,16,XxHash64,SwitchHash,Rice(12),15173332,17600016,0.8621203526178612,13.793938181818183 -5,5,24,XxHash64,SwitchHash,Rice(20),7811888,8400024,0.9299840095694965,22.31968 -5,5,32,XxHash64,SwitchHash,Rice(29),7676262,8000032,0.9595289118843524,30.705048 -5,6,16,XxHash64,SwitchHash,Rice(12),15173296,17600016,0.8621183071651753,13.793905454545454 -5,6,24,XxHash64,SwitchHash,Rice(20),7811888,8400024,0.9299840095694965,22.31968 -5,6,32,XxHash64,SwitchHash,Rice(29),7676265,8000032,0.9595292868828524,30.70506 -6,4,16,XxHash64,SwitchHash,Rice(11),20135802,24000016,0.8389911906725396,13.423868 -6,4,24,XxHash64,SwitchHash,Rice(20),9902490,10800024,0.9168951846773674,22.005533333333332 -6,4,32,XxHash64,SwitchHash,Rice(28),10611512,11200032,0.9474537215607955,30.318605714285713 -6,5,16,XxHash64,SwitchHash,Rice(11),24844748,30400016,0.8172610172310436,13.076183157894738 -6,5,24,XxHash64,SwitchHash,Rice(20),13025695,14400024,0.9045606451767025,21.70949166666667 -6,5,32,XxHash64,SwitchHash,Rice(28),13502491,14400032,0.9376709023979947,30.005535555555557 -6,6,16,XxHash64,SwitchHash,Rice(11),29537394,36800016,0.8026462271103361,12.842345217391305 -6,6,24,XxHash64,SwitchHash,Rice(19),16067591,18000024,0.8926427542541054,21.423454666666668 -6,6,32,XxHash64,SwitchHash,Rice(28),16385531,17600032,0.9309943868283875,29.791874545454544 -7,4,16,XxHash64,SwitchHash,Rice(10),38692472,49600016,0.7800899096484163,12.481442580645162 -7,4,24,XxHash64,SwitchHash,Rice(19),21008632,24000024,0.8753587913078753,21.008632 -7,4,32,XxHash64,SwitchHash,Rice(27),22067394,24000032,0.9194735240353012,29.423192 -7,5,16,XxHash64,SwitchHash,Rice(10),47241286,62400016,0.7570716969046931,12.113150256410256 -7,5,24,XxHash64,SwitchHash,Rice(19),25939815,30000024,0.8646598082721534,20.751852 -7,5,32,XxHash64,SwitchHash,Rice(27),27621378,30400032,0.9085970041084167,29.075134736842106 -7,6,16,XxHash64,SwitchHash,Rice(10),55781288,75200016,0.7417722889846193,11.86835914893617 -7,6,24,XxHash64,SwitchHash,Rice(18),31744895,37200024,0.853356841920317,20.480577419354837 -7,6,32,XxHash64,SwitchHash,Rice(27),33167665,36800032,0.9012944608309036,28.841447826086956 -8,4,16,XxHash64,SwitchHash,Rice(9),72523418,100800016,0.7194782389717082,11.51165365079365 -8,4,24,XxHash64,SwitchHash,Rice(18),41087420,49200024,0.8351097552310137,20.042643902439025 -8,4,32,XxHash64,SwitchHash,Rice(26),44145015,49600032,0.8900198895032971,28.48065483870968 -8,5,16,XxHash64,SwitchHash,Rice(9),87948412,126400016,0.695794310658948,11.132710379746836 -8,5,24,XxHash64,SwitchHash,Rice(18),51360818,62402520,0.8230567932192482,19.753370634405393 -8,5,32,XxHash64,SwitchHash,Rice(26),54820021,62400032,0.8785255270381913,28.112831282051282 -8,6,16,XxHash64,SwitchHash,Rice(9),103381468,152000016,0.6801411652482984,10.882259789473684 -8,6,24,XxHash64,SwitchHash,Rice(17),61457126,75600024,0.8129246890186173,19.51019873015873 -8,6,32,XxHash64,SwitchHash,Rice(26),65489668,75200032,0.8708728740966494,27.867943829787233 -9,4,16,XxHash64,SwitchHash,Rice(8),133707082,203200016,0.6580072414954928,10.528116692913386 -9,4,24,XxHash64,SwitchHash,Rice(17),79981280,100800024,0.7934648904448673,19.043161904761906 -9,4,32,XxHash64,SwitchHash,Rice(25),86658710,100800032,0.8597091516796344,27.510701587301586 -9,5,16,XxHash64,SwitchHash,Rice(8),161286456,254400016,0.6339876016359999,10.143802264150944 -9,5,24,XxHash64,SwitchHash,Rice(17),98514438,126002544,0.7818448332281291,18.764279571551427 -9,5,32,XxHash64,SwitchHash,Rice(25),107170448,126400032,0.8478672537044928,27.131758987341772 -9,6,16,XxHash64,SwitchHash,Rice(8),188903414,305600016,0.6181394113539576,9.89023109947644 -9,6,24,XxHash64,SwitchHash,Rice(16),117639188,152403072,0.771895122953952,18.525485868235393 -9,6,32,XxHash64,SwitchHash,Rice(25),127686389,152000032,0.8400418560438198,26.88134505263158 -10,4,16,XxHash64,SwitchHash,Rice(7),243236976,408000016,0.5961690354443515,9.538704941176471 -10,4,24,XxHash64,SwitchHash,Rice(16),152542600,202804080,0.7521673133992176,18.052017657871694 -10,4,32,XxHash64,SwitchHash,Rice(24),168439728,203200032,0.8289355387503089,26.525941417322834 -10,5,16,XxHash64,SwitchHash,Rice(7),291922420,510400016,0.5719482971176082,9.15117304075235 -10,5,24,XxHash64,SwitchHash,Rice(16),188306844,254400024,0.7401997886603973,17.764796603773586 -10,5,32,XxHash64,SwitchHash,Rice(24),207827123,254400032,0.8169304121785645,26.14177647798742 -10,6,24,XxHash64,SwitchHash,Rice(15),447107880,612000024,0.7305684027228078,17.533642352941175 -10,6,32,XxHash64,SwitchHash,Rice(24),247233692,305600032,0.8090106875381479,25.888344712041885 -11,4,24,XxHash64,SwitchHash,Rice(15),579771394,816000024,0.7105041384165449,17.05209982352941 -11,4,32,XxHash64,SwitchHash,Rice(23),325553053,408000032,0.7979240869275226,25.533572784313726 -11,5,24,XxHash64,SwitchHash,Rice(15),712623518,1020000024,0.6986504914043021,16.767612188235294 -11,5,32,XxHash64,SwitchHash,Rice(23),401088867,510400032,0.7858323704023592,25.146637429467084 -11,6,24,XxHash64,SwitchHash,Rice(14),845070908,1226400024,0.6890662846236213,16.537591154598825 -11,6,32,XxHash64,SwitchHash,Rice(23),476676949,612800032,0.7778670432575957,24.89174668407311 -12,4,24,XxHash64,SwitchHash,Rice(14),1093304060,1634400024,0.6689329686402403,16.05439148311307 -12,4,32,XxHash64,SwitchHash,Rice(22),626934134,817600032,0.7667980790881378,24.537539491193737 -12,5,24,XxHash64,SwitchHash,Rice(14),1343408968,2044800024,0.6569879461229897,15.76771089201878 -12,5,32,XxHash64,SwitchHash,Rice(22),771567726,1022400032,0.7546632451592099,24.149224600938968 -12,6,24,XxHash64,SwitchHash,Rice(13),1589701486,2455200024,0.647483492367382,15.539603968719453 -12,6,32,XxHash64,SwitchHash,Rice(22),916315673,1227200032,0.7466718131571887,23.893498644067797 -13,4,24,XxHash64,SwitchHash,Rice(13),2053428990,3273600024,0.6272693594041836,15.054464736070381 -13,4,32,XxHash64,SwitchHash,Rice(21),1204045542,1636800032,0.7356094320995223,23.53950228739003 -13,5,24,XxHash64,SwitchHash,Rice(13),2518020608,4092000024,0.615352051131855,14.768449313782991 -13,5,32,XxHash64,SwitchHash,Rice(21),1480471931,2046400032,0.7234518705285087,23.150460218921033 -13,6,24,XxHash64,SwitchHash,Rice(12),2976481930,4912800024,0.6058626273121839,14.540703126526624 -13,6,32,XxHash64,SwitchHash,Rice(21),1757139221,2456000032,0.7154475562319537,22.89432209771987 -14,4,24,XxHash64,SwitchHash,Rice(12),3835651134,6549600024,0.5856313545781189,14.055152561377794 -14,4,32,XxHash64,SwitchHash,Rice(20),2307072460,3275265536,0.7043924941785239,22.54056003393855 -14,5,24,XxHash64,SwitchHash,Rice(12),4697831262,8188800024,0.5736898261322103,13.768555867526377 -14,5,32,XxHash64,SwitchHash,Rice(20),2834236180,4094400032,0.6922225864226449,22.15112293864791 -14,6,24,XxHash64,SwitchHash,Rice(11),5545189892,9828000024,0.5642236343568002,13.541367257631258 -14,6,32,XxHash64,SwitchHash,Rice(20),3361948360,4913600032,0.6842128659445597,21.894811852816673 -15,4,24,XxHash64,SwitchHash,Rice(11),7128207494,13104000024,0.5439718773614679,13.05532508058608 -15,4,32,XxHash64,SwitchHash,Rice(19),4410518247,6552000032,0.6731560173166983,21.54099265934066 -15,5,24,XxHash64,SwitchHash,Rice(11),8714738866,16380000024,0.5320353390251008,12.768848155311355 -15,5,32,XxHash64,SwitchHash,Rice(19),5413708062,8190400032,0.6609821304024922,21.151428255518656 -15,6,24,XxHash64,SwitchHash,Rice(10),10273101128,19658400024,0.5225807347219541,12.54193764863875 -15,6,32,XxHash64,SwitchHash,Rice(19),6418168272,9829193184,0.6529699998619948,20.895040063609894 -16,4,24,XxHash64,SwitchHash,Rice(10),13166086420,26210400024,0.5023229865986115,12.055751689405731 -16,4,32,XxHash64,SwitchHash,Rice(18),8412670768,13105600032,0.6419142006057522,20.541254469539737 -16,5,24,XxHash64,SwitchHash,Rice(10),16067188462,32764800024,0.49037956740864863,11.769109626428362 -16,5,32,XxHash64,SwitchHash,Rice(18),10317030031,16383055328,0.6297378495308711,20.15161122434876 -16,6,24,XxHash64,SwitchHash,Rice(9),18910394212,39319200024,0.4809455482425204,11.54269316486602 -16,6,32,XxHash64,SwitchHash,Rice(18),12222594784,19659200032,0.6217239136945977,19.895165270611216 -17,4,24,XxHash64,SwitchHash,Rice(9),24151344142,52425600024,0.4606784496685535,11.056282797106757 -17,4,32,XxHash64,SwitchHash,Rice(17),16007322862,26212800032,0.610668178998757,19.541381751815905 -17,5,24,XxHash64,SwitchHash,Rice(9),29406471552,65532000024,0.44873453490249604,10.769628841604101 -17,5,32,XxHash64,SwitchHash,Rice(17),19610364342,32766400032,0.5984900484291322,19.151681568435958 -17,6,24,XxHash64,SwitchHash,Rice(8),34549737960,78640800024,0.43933604375153784,10.5440650532548 -17,6,32,XxHash64,SwitchHash,Rice(17),23218420649,39321572832,0.5904753797158588,18.89521216628446 -18,4,24,XxHash64,SwitchHash,Rice(8),43939753354,104853600024,0.41905812813239224,10.057395077479457 -18,4,32,XxHash64,SwitchHash,Rice(16),30377985475,52428248576,0.5794201847304524,18.5414459226914 -18,5,24,XxHash64,SwitchHash,Rice(8),53359150474,131068800024,0.4071079499028709,9.770590799457995 -18,5,32,XxHash64,SwitchHash,Rice(16),37176055754,65538332096,0.5672414076626916,18.15172505406896 -18,6,32,XxHash64,SwitchHash,Rice(16),87956904490,157283200032,0.5592263157928168,17.895242109011008 +precision,bit_size,hash_size,hasher,composite_hash,code,space_usage,uncompressed_space_usage,rate,mean_gap_size,number_of_hashes,number_of_hashes_with_code,extra_hashes +4,4,8,AHasher,CurrentHash,Golomb(45),11428126,12800000,0.8928,7.1426,16,17,1 +4,4,8,AHasher,SwitchHash,Golomb(45),11428134,12800000,0.8928,7.1426,16,17,1 +4,4,8,WyHash,CurrentHash,Golomb(45),11428394,12800000,0.8928,7.1427,16,17,1 +4,4,8,WyHash,SwitchHash,Golomb(45),11428398,12800000,0.8928,7.1427,16,17,1 +4,4,8,XxHash64,CurrentHash,Golomb(45),11428866,12800000,0.8929,7.1430,16,17,1 +4,4,8,XxHash64,SwitchHash,Golomb(45),11428848,12800000,0.8929,7.1430,16,17,1 +4,4,16,AHasher,CurrentHash,Rice(14),6379133,6402496,0.9964,15.9416,4,4,0 +4,4,16,AHasher,SwitchHash,Rice(14),6377973,6401280,0.9964,15.9417,4,4,0 +4,4,16,WyHash,CurrentHash,Rice(14),6379237,6402496,0.9964,15.9419,4,4,0 +4,4,16,WyHash,SwitchHash,Rice(14),6377845,6401088,0.9964,15.9419,4,4,0 +4,4,16,XxHash64,CurrentHash,Rice(14),6379491,6402688,0.9964,15.9420,4,4,0 +4,4,16,XxHash64,SwitchHash,Rice(14),6378239,6401408,0.9964,15.9421,4,4,0 +4,4,32,AHasher,CurrentHash,Rice(31),6500436,6400000,1.0157,32.5022,2,1,0 +4,4,32,AHasher,SwitchHash,Rice(31),6500430,6400000,1.0157,32.5022,2,1,0 +4,4,32,WyHash,CurrentHash,Rice(31),6499997,6400000,1.0156,32.5000,2,1,0 +4,4,32,WyHash,SwitchHash,Rice(31),6500008,6400000,1.0156,32.5000,2,1,0 +4,4,32,XxHash64,CurrentHash,Rice(31),6500118,6400000,1.0156,32.5006,2,1,0 +4,4,32,XxHash64,SwitchHash,Rice(31),6500080,6400000,1.0156,32.5004,2,1,0 +4,5,16,AHasher,CurrentHash,Rice(13),24365660,25600000,0.9518,15.2285,16,16,0 +4,5,16,AHasher,SwitchHash,Rice(13),24365408,25600000,0.9518,15.2284,16,16,0 +4,5,16,WyHash,CurrentHash,Rice(13),24366394,25600000,0.9518,15.2290,16,16,0 +4,5,16,WyHash,SwitchHash,Rice(13),24366524,25600000,0.9518,15.2291,16,16,0 +4,5,16,XxHash64,CurrentHash,Rice(13),24366472,25600000,0.9518,15.2290,16,16,0 +4,5,16,XxHash64,SwitchHash,Rice(13),24365970,25600000,0.9518,15.2287,16,16,0 +4,5,24,AHasher,CurrentHash,Rice(22),11880794,12000000,0.9901,23.7616,5,5,0 +4,5,24,AHasher,SwitchHash,Rice(22),11880725,12000000,0.9901,23.7614,5,5,0 +4,5,24,WyHash,CurrentHash,Rice(22),11881217,12000000,0.9901,23.7624,5,5,0 +4,5,24,WyHash,SwitchHash,Rice(22),11881215,12000000,0.9901,23.7624,5,5,0 +4,5,24,XxHash64,CurrentHash,Rice(22),11880944,12000000,0.9901,23.7619,5,5,0 +4,5,24,XxHash64,SwitchHash,Rice(22),11881109,12000000,0.9901,23.7622,5,5,0 +4,5,32,AHasher,CurrentHash,Rice(30),12776654,12800000,0.9982,31.9416,4,4,0 +4,5,32,AHasher,SwitchHash,Rice(30),12776675,12800000,0.9982,31.9417,4,4,0 +4,5,32,WyHash,CurrentHash,Rice(30),12776729,12800000,0.9982,31.9418,4,4,0 +4,5,32,WyHash,SwitchHash,Rice(30),12776750,12800000,0.9982,31.9419,4,4,0 +4,5,32,XxHash64,CurrentHash,Rice(30),12776727,12800000,0.9982,31.9418,4,4,0 +4,5,32,XxHash64,SwitchHash,Rice(30),12776791,12800000,0.9982,31.9420,4,4,0 +4,6,16,AHasher,CurrentHash,Rice(13),24366034,25600000,0.9518,15.2288,16,16,0 +4,6,16,AHasher,SwitchHash,Rice(13),24365376,25600000,0.9518,15.2284,16,16,0 +4,6,16,WyHash,CurrentHash,Rice(13),24366720,25600000,0.9518,15.2292,16,16,0 +4,6,16,WyHash,SwitchHash,Rice(13),24366506,25600000,0.9518,15.2291,16,16,0 +4,6,16,XxHash64,CurrentHash,Rice(13),24366752,25600000,0.9518,15.2292,16,16,0 +4,6,16,XxHash64,SwitchHash,Rice(13),24365948,25600000,0.9518,15.2287,16,16,0 +4,6,24,AHasher,CurrentHash,Rice(22),11880880,12000120,0.9901,23.7615,5,5,0 +4,6,24,AHasher,SwitchHash,Rice(22),11880722,12000000,0.9901,23.7614,5,5,0 +4,6,24,WyHash,CurrentHash,Rice(22),11881329,12000120,0.9901,23.7624,5,5,0 +4,6,24,WyHash,SwitchHash,Rice(22),11881218,12000000,0.9901,23.7624,5,5,0 +4,6,24,XxHash64,CurrentHash,Rice(22),11880899,12000000,0.9901,23.7618,5,5,0 +4,6,24,XxHash64,SwitchHash,Rice(22),11881109,12000000,0.9901,23.7622,5,5,0 +4,6,32,AHasher,CurrentHash,Rice(30),12776645,12800000,0.9982,31.9416,4,4,0 +4,6,32,AHasher,SwitchHash,Rice(30),12776671,12800000,0.9982,31.9417,4,4,0 +4,6,32,WyHash,CurrentHash,Rice(30),12776690,12800000,0.9982,31.9417,4,4,0 +4,6,32,WyHash,SwitchHash,Rice(30),12776751,12800000,0.9982,31.9419,4,4,0 +4,6,32,XxHash64,CurrentHash,Rice(30),12776673,12800000,0.9982,31.9417,4,4,0 +4,6,32,XxHash64,SwitchHash,Rice(30),12776790,12800000,0.9982,31.9420,4,4,0 +5,4,16,AHasher,CurrentHash,Rice(13),24365266,25600000,0.9518,15.2283,16,16,0 +5,4,16,AHasher,SwitchHash,Rice(13),24365390,25600000,0.9518,15.2284,16,16,0 +5,4,16,WyHash,CurrentHash,Rice(13),24368586,25600000,0.9519,15.2304,16,16,0 +5,4,16,WyHash,SwitchHash,Rice(13),24368632,25600000,0.9519,15.2304,16,16,0 +5,4,16,XxHash64,CurrentHash,Rice(13),24365496,25600000,0.9518,15.2284,16,16,0 +5,4,16,XxHash64,SwitchHash,Rice(13),24365904,25600000,0.9518,15.2287,16,16,0 +5,4,24,AHasher,CurrentHash,Rice(22),11880831,12000000,0.9901,23.7617,5,5,0 +5,4,24,AHasher,SwitchHash,Rice(22),11880789,12000000,0.9901,23.7616,5,5,0 +5,4,24,WyHash,CurrentHash,Rice(22),11881194,12000120,0.9901,23.7622,5,5,0 +5,4,24,WyHash,SwitchHash,Rice(22),11881060,12000000,0.9901,23.7621,5,5,0 +5,4,24,XxHash64,CurrentHash,Rice(22),11881078,12000000,0.9901,23.7622,5,5,0 +5,4,24,XxHash64,SwitchHash,Rice(22),11881078,12000000,0.9901,23.7622,5,5,0 +5,4,32,AHasher,CurrentHash,Rice(30),12776471,12800000,0.9982,31.9412,4,4,0 +5,4,32,AHasher,SwitchHash,Rice(30),12776570,12800000,0.9982,31.9414,4,4,0 +5,4,32,WyHash,CurrentHash,Rice(30),12776664,12800000,0.9982,31.9417,4,4,0 +5,4,32,WyHash,SwitchHash,Rice(30),12776667,12800000,0.9982,31.9417,4,4,0 +5,4,32,XxHash64,CurrentHash,Rice(30),12776575,12800000,0.9982,31.9414,4,4,0 +5,4,32,XxHash64,SwitchHash,Rice(30),12776530,12800000,0.9982,31.9413,4,4,0 +5,5,16,AHasher,CurrentHash,ExpGolomb(12),35014680,38400000,0.9118,14.5894,24,26,2 +5,5,16,AHasher,SwitchHash,ExpGolomb(12),35012012,38400000,0.9118,14.5883,24,26,2 +5,5,16,WyHash,CurrentHash,ExpGolomb(12),35019708,38400000,0.9120,14.5915,24,26,2 +5,5,16,WyHash,SwitchHash,ExpGolomb(12),35017392,38400000,0.9119,14.5906,24,26,2 +5,5,16,XxHash64,CurrentHash,ExpGolomb(12),35017288,38400000,0.9119,14.5905,24,26,2 +5,5,16,XxHash64,SwitchHash,ExpGolomb(12),35014944,38400000,0.9118,14.5896,24,26,2 +5,5,24,AHasher,CurrentHash,Rice(21),18582496,19200000,0.9678,23.2281,8,8,0 +5,5,24,AHasher,SwitchHash,Rice(21),18582610,19200000,0.9678,23.2283,8,8,0 +5,5,24,WyHash,CurrentHash,Rice(21),18584135,19200000,0.9679,23.2302,8,8,0 +5,5,24,WyHash,SwitchHash,Rice(21),18584254,19200000,0.9679,23.2303,8,8,0 +5,5,24,XxHash64,CurrentHash,Rice(21),18582982,19200192,0.9679,23.2285,8,8,0 +5,5,24,XxHash64,SwitchHash,Rice(21),18582883,19200000,0.9679,23.2286,8,8,0 +5,5,32,AHasher,CurrentHash,Rice(30),18977582,19200000,0.9884,31.6293,6,6,0 +5,5,32,AHasher,SwitchHash,Rice(30),18977608,19200000,0.9884,31.6293,6,6,0 +5,5,32,WyHash,CurrentHash,Rice(30),18977847,19200000,0.9884,31.6297,6,6,0 +5,5,32,WyHash,SwitchHash,Rice(30),18977822,19200000,0.9884,31.6297,6,6,0 +5,5,32,XxHash64,CurrentHash,Rice(30),18977642,19200000,0.9884,31.6294,6,6,0 +5,5,32,XxHash64,SwitchHash,Rice(30),18977687,19200000,0.9884,31.6295,6,6,0 +5,6,16,AHasher,CurrentHash,ExpGolomb(12),35016788,38400000,0.9119,14.5903,24,26,2 +5,6,16,AHasher,SwitchHash,ExpGolomb(12),35011924,38400000,0.9118,14.5883,24,26,2 +5,6,16,WyHash,CurrentHash,ExpGolomb(12),35021944,38400000,0.9120,14.5925,24,26,2 +5,6,16,WyHash,SwitchHash,ExpGolomb(12),35017276,38400000,0.9119,14.5905,24,26,2 +5,6,16,XxHash64,CurrentHash,ExpGolomb(12),35019060,38400000,0.9120,14.5913,24,26,2 +5,6,16,XxHash64,SwitchHash,ExpGolomb(12),35014840,38400000,0.9118,14.5895,24,26,2 +5,6,24,AHasher,CurrentHash,Rice(21),18582614,19200000,0.9678,23.2283,8,8,0 +5,6,24,AHasher,SwitchHash,Rice(21),18582615,19200000,0.9678,23.2283,8,8,0 +5,6,24,WyHash,CurrentHash,Rice(21),18584604,19200576,0.9679,23.2301,8,8,0 +5,6,24,WyHash,SwitchHash,Rice(21),18584246,19200000,0.9679,23.2303,8,8,0 +5,6,24,XxHash64,CurrentHash,Rice(21),18582927,19200192,0.9679,23.2284,8,8,0 +5,6,24,XxHash64,SwitchHash,Rice(21),18582887,19200000,0.9679,23.2286,8,8,0 +5,6,32,AHasher,CurrentHash,Rice(30),18977563,19200000,0.9884,31.6293,6,6,0 +5,6,32,AHasher,SwitchHash,Rice(30),18977607,19200000,0.9884,31.6293,6,6,0 +5,6,32,WyHash,CurrentHash,Rice(30),18977822,19200000,0.9884,31.6297,6,6,0 +5,6,32,WyHash,SwitchHash,Rice(30),18977821,19200000,0.9884,31.6297,6,6,0 +5,6,32,XxHash64,CurrentHash,Rice(30),18977555,19200000,0.9884,31.6293,6,6,0 +5,6,32,XxHash64,SwitchHash,Rice(30),18977687,19200000,0.9884,31.6295,6,6,0 +6,4,16,AHasher,CurrentHash,ExpGolomb(11),45130120,51200000,0.8814,14.1032,32,36,4 +6,4,16,AHasher,SwitchHash,ExpGolomb(11),45127328,51200000,0.8814,14.1023,32,36,4 +6,4,16,WyHash,CurrentHash,ExpGolomb(11),45135264,51200000,0.8815,14.1048,32,36,4 +6,4,16,WyHash,SwitchHash,ExpGolomb(11),45133796,51200000,0.8815,14.1043,32,36,4 +6,4,16,XxHash64,CurrentHash,ExpGolomb(11),45129972,51200000,0.8814,14.1031,32,36,4 +6,4,16,XxHash64,SwitchHash,ExpGolomb(11),45129060,51200000,0.8814,14.1028,32,36,4 +6,4,24,AHasher,CurrentHash,ExpGolomb(20),22870638,24000000,0.9529,22.8706,10,10,0 +6,4,24,AHasher,SwitchHash,ExpGolomb(20),22870562,24000000,0.9529,22.8706,10,10,0 +6,4,24,WyHash,CurrentHash,ExpGolomb(20),22871632,24000000,0.9530,22.8716,10,10,0 +6,4,24,WyHash,SwitchHash,ExpGolomb(20),22871564,24000000,0.9530,22.8716,10,10,0 +6,4,24,XxHash64,CurrentHash,ExpGolomb(20),22869650,24000000,0.9529,22.8697,10,10,0 +6,4,24,XxHash64,SwitchHash,ExpGolomb(20),22869646,24000000,0.9529,22.8696,10,10,0 +6,4,32,AHasher,CurrentHash,Rice(29),24982647,25600000,0.9759,31.2283,8,8,0 +6,4,32,AHasher,SwitchHash,Rice(29),24982678,25600000,0.9759,31.2283,8,8,0 +6,4,32,WyHash,CurrentHash,Rice(29),24983054,25600000,0.9759,31.2288,8,8,0 +6,4,32,WyHash,SwitchHash,Rice(29),24983200,25600000,0.9759,31.2290,8,8,0 +6,4,32,XxHash64,CurrentHash,Rice(29),24983616,25600000,0.9759,31.2295,8,8,0 +6,4,32,XxHash64,SwitchHash,Rice(29),24983546,25600000,0.9759,31.2294,8,8,0 +6,5,16,AHasher,CurrentHash,ExpGolomb(11),54938320,64000000,0.8584,13.7346,40,46,6 +6,5,16,AHasher,SwitchHash,ExpGolomb(11),54930872,64000000,0.8583,13.7327,40,46,6 +6,5,16,WyHash,CurrentHash,ExpGolomb(11),54942160,64000000,0.8585,13.7355,40,46,6 +6,5,16,WyHash,SwitchHash,ExpGolomb(11),54934328,64000000,0.8583,13.7336,40,46,6 +6,5,16,XxHash64,CurrentHash,ExpGolomb(11),54939664,64000000,0.8584,13.7349,40,46,6 +6,5,16,XxHash64,SwitchHash,ExpGolomb(11),54933184,64000000,0.8583,13.7333,40,46,6 +6,5,24,AHasher,CurrentHash,ExpGolomb(20),29214824,31200624,0.9364,22.4725,13,13,0 +6,5,24,AHasher,SwitchHash,ExpGolomb(20),29214014,31200000,0.9363,22.4723,13,13,0 +6,5,24,WyHash,CurrentHash,ExpGolomb(20),29214918,31200624,0.9364,22.4726,13,13,0 +6,5,24,WyHash,SwitchHash,ExpGolomb(20),29214398,31200000,0.9364,22.4726,13,13,0 +6,5,24,XxHash64,CurrentHash,ExpGolomb(20),29213341,31200312,0.9363,22.4716,13,13,0 +6,5,24,XxHash64,SwitchHash,ExpGolomb(20),29213020,31200000,0.9363,22.4716,13,13,0 +6,5,32,AHasher,CurrentHash,ExpGolomb(28),30870932,32000000,0.9647,30.8709,10,10,0 +6,5,32,AHasher,SwitchHash,ExpGolomb(28),30870558,32000000,0.9647,30.8706,10,10,0 +6,5,32,WyHash,CurrentHash,ExpGolomb(28),30871502,32000000,0.9647,30.8715,10,10,0 +6,5,32,WyHash,SwitchHash,ExpGolomb(28),30871572,32000000,0.9647,30.8716,10,10,0 +6,5,32,XxHash64,CurrentHash,ExpGolomb(28),30869574,32000000,0.9647,30.8696,10,10,0 +6,5,32,XxHash64,SwitchHash,ExpGolomb(28),30869634,32000000,0.9647,30.8696,10,10,0 +6,6,16,AHasher,CurrentHash,ExpGolomb(11),64616588,76800000,0.8414,13.4618,48,57,9 +6,6,16,AHasher,SwitchHash,ExpGolomb(11),64598676,76800000,0.8411,13.4581,48,57,9 +6,6,16,WyHash,CurrentHash,ExpGolomb(11),64622372,76800000,0.8414,13.4630,48,57,9 +6,6,16,WyHash,SwitchHash,ExpGolomb(11),64604952,76800000,0.8412,13.4594,48,57,9 +6,6,16,XxHash64,CurrentHash,ExpGolomb(11),64620480,76800000,0.8414,13.4626,48,57,9 +6,6,16,XxHash64,SwitchHash,ExpGolomb(11),64600832,76800000,0.8412,13.4585,48,57,9 +6,6,24,AHasher,CurrentHash,ExpGolomb(19),35362656,38400384,0.9209,22.1014,16,17,1 +6,6,24,AHasher,SwitchHash,ExpGolomb(19),35362652,38400000,0.9209,22.1017,16,17,1 +6,6,24,WyHash,CurrentHash,ExpGolomb(19),35366722,38401152,0.9210,22.1035,16,17,1 +6,6,24,WyHash,SwitchHash,ExpGolomb(19),35365966,38400000,0.9210,22.1037,16,17,1 +6,6,24,XxHash64,CurrentHash,ExpGolomb(19),35364166,38401152,0.9209,22.1019,16,17,1 +6,6,24,XxHash64,SwitchHash,ExpGolomb(19),35363614,38400000,0.9209,22.1023,16,17,1 +6,6,32,AHasher,CurrentHash,ExpGolomb(28),36706156,38400000,0.9559,30.5885,12,12,0 +6,6,32,AHasher,SwitchHash,ExpGolomb(28),36706128,38400000,0.9559,30.5884,12,12,0 +6,6,32,WyHash,CurrentHash,ExpGolomb(28),36707358,38400000,0.9559,30.5895,12,12,0 +6,6,32,WyHash,SwitchHash,ExpGolomb(28),36707106,38400000,0.9559,30.5893,12,12,0 +6,6,32,XxHash64,CurrentHash,ExpGolomb(28),36705938,38400000,0.9559,30.5883,12,12,0 +6,6,32,XxHash64,SwitchHash,ExpGolomb(28),36705924,38400000,0.9559,30.5883,12,12,0 +7,4,16,AHasher,CurrentHash,ExpGolomb(10),83035360,102400000,0.8109,12.9743,64,78,14 +7,4,16,AHasher,SwitchHash,ExpGolomb(10),83028320,102400000,0.8108,12.9732,64,78,14 +7,4,16,WyHash,CurrentHash,ExpGolomb(10),83044112,102400000,0.8110,12.9756,64,78,14 +7,4,16,WyHash,SwitchHash,ExpGolomb(10),83035816,102400000,0.8109,12.9743,64,78,14 +7,4,16,XxHash64,CurrentHash,ExpGolomb(10),83042380,102400000,0.8110,12.9754,64,78,14 +7,4,16,XxHash64,SwitchHash,ExpGolomb(10),83033716,102400000,0.8109,12.9740,64,78,14 +7,4,24,AHasher,CurrentHash,ExpGolomb(19),45480898,50400504,0.9024,21.6574,21,23,2 +7,4,24,AHasher,SwitchHash,ExpGolomb(19),45480376,50400000,0.9024,21.6573,21,23,2 +7,4,24,WyHash,CurrentHash,ExpGolomb(19),45481242,50400504,0.9024,21.6575,21,23,2 +7,4,24,WyHash,SwitchHash,ExpGolomb(19),45481206,50400504,0.9024,21.6575,21,23,2 +7,4,24,XxHash64,CurrentHash,ExpGolomb(19),45479508,50401512,0.9023,21.6563,21,23,2 +7,4,24,XxHash64,SwitchHash,ExpGolomb(19),45478206,50400000,0.9023,21.6563,21,23,2 +7,4,32,AHasher,CurrentHash,ExpGolomb(27),48164734,51200000,0.9407,30.1030,16,17,1 +7,4,32,AHasher,SwitchHash,ExpGolomb(27),48165038,51200000,0.9407,30.1031,16,17,1 +7,4,32,WyHash,CurrentHash,ExpGolomb(27),48164746,51200000,0.9407,30.1030,16,17,1 +7,4,32,WyHash,SwitchHash,ExpGolomb(27),48164268,51200000,0.9407,30.1027,16,17,1 +7,4,32,XxHash64,CurrentHash,ExpGolomb(27),48162874,51200000,0.9407,30.1018,16,17,1 +7,4,32,XxHash64,SwitchHash,ExpGolomb(27),48162604,51200000,0.9407,30.1016,16,17,1 +7,5,16,AHasher,CurrentHash,ExpGolomb(10),100967676,128000000,0.7888,12.6210,80,101,21 +7,5,16,AHasher,SwitchHash,ExpGolomb(10),100938860,128000000,0.7886,12.6174,80,101,21 +7,5,16,WyHash,CurrentHash,ExpGolomb(10),100972552,128000000,0.7888,12.6216,80,101,21 +7,5,16,WyHash,SwitchHash,ExpGolomb(10),100945984,128000000,0.7886,12.6182,80,101,21 +7,5,16,XxHash64,CurrentHash,ExpGolomb(10),100970732,128000000,0.7888,12.6213,80,101,21 +7,5,16,XxHash64,SwitchHash,ExpGolomb(10),100942188,128000000,0.7886,12.6178,80,101,21 +7,5,24,AHasher,CurrentHash,ExpGolomb(18),55472950,62401872,0.8890,21.3351,26,29,3 +7,5,24,AHasher,SwitchHash,ExpGolomb(18),55471968,62400000,0.8890,21.3354,26,29,3 +7,5,24,WyHash,CurrentHash,ExpGolomb(18),55476050,62401248,0.8890,21.3365,26,29,3 +7,5,24,WyHash,SwitchHash,ExpGolomb(18),55475482,62400000,0.8890,21.3367,26,29,3 +7,5,24,XxHash64,CurrentHash,ExpGolomb(18),55473902,62400624,0.8890,21.3359,26,29,3 +7,5,24,XxHash64,SwitchHash,ExpGolomb(18),55474346,62400000,0.8890,21.3363,26,29,3 +7,5,32,AHasher,CurrentHash,ExpGolomb(27),59467326,64000000,0.9292,29.7337,20,21,1 +7,5,32,AHasher,SwitchHash,ExpGolomb(27),59467010,64000000,0.9292,29.7335,20,21,1 +7,5,32,WyHash,CurrentHash,ExpGolomb(27),59466672,64000000,0.9292,29.7333,20,21,1 +7,5,32,WyHash,SwitchHash,ExpGolomb(27),59466672,64000000,0.9292,29.7333,20,21,1 +7,5,32,XxHash64,CurrentHash,ExpGolomb(27),59463798,64000000,0.9291,29.7319,20,21,1 +7,5,32,XxHash64,SwitchHash,ExpGolomb(27),59464164,64000000,0.9291,29.7321,20,21,1 +7,6,16,AHasher,CurrentHash,ExpGolomb(10),118670552,153600000,0.7726,12.3615,96,124,28 +7,6,16,AHasher,SwitchHash,ExpGolomb(10),118595268,153600000,0.7721,12.3537,96,124,28 +7,6,16,WyHash,CurrentHash,ExpGolomb(10),118674992,153600000,0.7726,12.3620,96,124,28 +7,6,16,WyHash,SwitchHash,ExpGolomb(10),118602044,153600000,0.7721,12.3544,96,124,28 +7,6,16,XxHash64,CurrentHash,ExpGolomb(10),118673220,153600000,0.7726,12.3618,96,124,28 +7,6,16,XxHash64,SwitchHash,ExpGolomb(10),118596284,153600000,0.7721,12.3538,96,124,28 +7,6,24,AHasher,CurrentHash,ExpGolomb(18),67112582,76803072,0.8738,20.9718,32,36,4 +7,6,24,AHasher,SwitchHash,ExpGolomb(18),67110972,76800768,0.8738,20.9720,32,36,4 +7,6,24,WyHash,CurrentHash,ExpGolomb(18),67116990,76803840,0.8739,20.9730,32,36,4 +7,6,24,WyHash,SwitchHash,ExpGolomb(18),67114866,76800768,0.8739,20.9732,32,36,4 +7,6,24,XxHash64,CurrentHash,ExpGolomb(18),67113184,76800768,0.8739,20.9727,32,36,4 +7,6,24,XxHash64,SwitchHash,ExpGolomb(18),67113106,76800000,0.8739,20.9728,32,36,4 +7,6,32,AHasher,CurrentHash,ExpGolomb(27),70701170,76800000,0.9206,29.4588,24,26,2 +7,6,32,AHasher,SwitchHash,ExpGolomb(27),70700878,76800000,0.9206,29.4587,24,26,2 +7,6,32,WyHash,CurrentHash,ExpGolomb(27),70699618,76800000,0.9206,29.4582,24,26,2 +7,6,32,WyHash,SwitchHash,ExpGolomb(27),70699576,76800000,0.9206,29.4582,24,26,2 +7,6,32,XxHash64,CurrentHash,ExpGolomb(27),70697712,76800000,0.9205,29.4574,24,26,2 +7,6,32,XxHash64,SwitchHash,ExpGolomb(27),70697694,76800000,0.9205,29.4574,24,26,2 +8,4,16,AHasher,CurrentHash,ExpGolomb(9),152082280,204800000,0.7426,11.8814,128,172,44 +8,4,16,AHasher,SwitchHash,ExpGolomb(9),152047656,204800000,0.7424,11.8787,128,172,44 +8,4,16,WyHash,CurrentHash,ExpGolomb(9),152095624,204800000,0.7427,11.8825,128,172,44 +8,4,16,WyHash,SwitchHash,ExpGolomb(9),152059752,204800000,0.7425,11.8797,128,172,44 +8,4,16,XxHash64,CurrentHash,ExpGolomb(9),152091228,204800000,0.7426,11.8821,128,172,44 +8,4,16,XxHash64,SwitchHash,ExpGolomb(9),152055484,204800000,0.7425,11.8793,128,172,44 +8,4,24,AHasher,CurrentHash,ExpGolomb(18),86284678,100801008,0.8560,20.5438,42,49,7 +8,4,24,AHasher,SwitchHash,ExpGolomb(18),86284312,100800000,0.8560,20.5439,42,49,7 +8,4,24,WyHash,CurrentHash,ExpGolomb(18),86284824,100800000,0.8560,20.5440,42,49,7 +8,4,24,WyHash,SwitchHash,ExpGolomb(18),86285852,100802016,0.8560,20.5438,42,49,7 +8,4,24,XxHash64,CurrentHash,ExpGolomb(18),86285388,100801008,0.8560,20.5439,42,49,7 +8,4,24,XxHash64,SwitchHash,ExpGolomb(18),86285112,100800000,0.8560,20.5441,42,49,7 +8,4,32,AHasher,CurrentHash,ExpGolomb(26),92711792,102400000,0.9054,28.9724,32,35,3 +8,4,32,AHasher,SwitchHash,ExpGolomb(26),92711828,102400000,0.9054,28.9724,32,35,3 +8,4,32,WyHash,CurrentHash,ExpGolomb(26),92714950,102400000,0.9054,28.9734,32,35,3 +8,4,32,WyHash,SwitchHash,ExpGolomb(26),92714658,102400000,0.9054,28.9733,32,35,3 +8,4,32,XxHash64,CurrentHash,ExpGolomb(26),92710462,102400000,0.9054,28.9720,32,35,3 +8,4,32,XxHash64,SwitchHash,ExpGolomb(26),92711042,102400000,0.9054,28.9722,32,35,3 +8,5,16,AHasher,CurrentHash,ExpGolomb(9),184690732,256000000,0.7214,11.5432,160,221,61 +8,5,16,AHasher,SwitchHash,ExpGolomb(9),184567876,256000000,0.7210,11.5355,160,221,61 +8,5,16,WyHash,CurrentHash,ExpGolomb(9),184707808,256000000,0.7215,11.5442,160,221,61 +8,5,16,WyHash,SwitchHash,ExpGolomb(9),184583616,256000000,0.7210,11.5365,160,221,61 +8,5,16,XxHash64,CurrentHash,ExpGolomb(9),184695080,256000000,0.7215,11.5434,160,221,61 +8,5,16,XxHash64,SwitchHash,ExpGolomb(9),184575300,256000000,0.7210,11.5360,160,221,61 +8,5,24,AHasher,CurrentHash,ExpGolomb(17),107031558,127205088,0.8414,20.1938,53,62,9 +8,5,24,AHasher,SwitchHash,ExpGolomb(17),107027042,127200000,0.8414,20.1938,53,62,9 +8,5,24,WyHash,CurrentHash,ExpGolomb(17),107037332,127206360,0.8414,20.1947,53,62,9 +8,5,24,WyHash,SwitchHash,ExpGolomb(17),107036212,127205088,0.8414,20.1947,53,62,9 +8,5,24,XxHash64,CurrentHash,ExpGolomb(17),107031204,127201272,0.8414,20.1944,53,62,9 +8,5,24,XxHash64,SwitchHash,ExpGolomb(17),107032232,127202544,0.8414,20.1944,53,62,9 +8,5,32,AHasher,CurrentHash,ExpGolomb(26),114467438,128000000,0.8943,28.6169,40,44,4 +8,5,32,AHasher,SwitchHash,ExpGolomb(26),114467526,128000000,0.8943,28.6169,40,44,4 +8,5,32,WyHash,CurrentHash,ExpGolomb(26),114467922,128000000,0.8943,28.6170,40,44,4 +8,5,32,WyHash,SwitchHash,ExpGolomb(26),114467902,128000000,0.8943,28.6170,40,44,4 +8,5,32,XxHash64,CurrentHash,ExpGolomb(26),114466872,128000000,0.8943,28.6167,40,44,4 +8,5,32,XxHash64,SwitchHash,ExpGolomb(26),114467428,128000000,0.8943,28.6169,40,44,4 +8,6,16,AHasher,CurrentHash,ExpGolomb(9),216916536,307200000,0.7061,11.2977,192,271,79 +8,6,16,AHasher,SwitchHash,ExpGolomb(9),216600936,307200000,0.7051,11.2813,192,272,80 +8,6,16,WyHash,CurrentHash,ExpGolomb(9),216927876,307200000,0.7061,11.2983,192,271,79 +8,6,16,WyHash,SwitchHash,ExpGolomb(9),216612012,307200000,0.7051,11.2819,192,272,80 +8,6,16,XxHash64,CurrentHash,ExpGolomb(9),216921700,307200000,0.7061,11.2980,192,271,79 +8,6,16,XxHash64,SwitchHash,ExpGolomb(9),216608448,307200000,0.7051,11.2817,192,272,80 +8,6,24,AHasher,CurrentHash,ExpGolomb(17),127213208,153603072,0.8282,19.8767,64,77,13 +8,6,24,AHasher,SwitchHash,ExpGolomb(17),127213668,153603072,0.8282,19.8767,64,77,13 +8,6,24,WyHash,CurrentHash,ExpGolomb(17),127230036,153615360,0.8282,19.8777,64,77,13 +8,6,24,WyHash,SwitchHash,ExpGolomb(17),127217342,153600000,0.8282,19.8777,64,77,13 +8,6,24,XxHash64,CurrentHash,ExpGolomb(17),127231384,153618432,0.8282,19.8775,64,77,13 +8,6,24,XxHash64,SwitchHash,ExpGolomb(17),127215060,153600000,0.8282,19.8774,64,77,13 +8,6,32,AHasher,CurrentHash,ExpGolomb(26),136095720,153600000,0.8860,28.3533,48,54,6 +8,6,32,AHasher,SwitchHash,ExpGolomb(26),136095494,153600000,0.8860,28.3532,48,54,6 +8,6,32,WyHash,CurrentHash,ExpGolomb(26),136095658,153600000,0.8860,28.3533,48,54,6 +8,6,32,WyHash,SwitchHash,ExpGolomb(26),136095612,153600000,0.8860,28.3533,48,54,6 +8,6,32,XxHash64,CurrentHash,ExpGolomb(26),136096054,153600000,0.8860,28.3533,48,54,6 +8,6,32,XxHash64,SwitchHash,ExpGolomb(26),136095326,153600000,0.8860,28.3532,48,54,6 +9,4,16,AHasher,CurrentHash,ExpGolomb(8),277096740,409600000,0.6765,10.8241,256,378,122 +9,4,16,AHasher,SwitchHash,ExpGolomb(8),276940524,409600000,0.6761,10.8180,256,378,122 +9,4,16,WyHash,CurrentHash,ExpGolomb(8),277106880,409600000,0.6765,10.8245,256,378,122 +9,4,16,WyHash,SwitchHash,ExpGolomb(8),276950264,409600000,0.6761,10.8184,256,378,122 +9,4,16,XxHash64,CurrentHash,ExpGolomb(8),277101912,409600000,0.6765,10.8243,256,378,122 +9,4,16,XxHash64,SwitchHash,ExpGolomb(8),276948944,409600000,0.6761,10.8183,256,378,122 +9,4,24,AHasher,CurrentHash,ExpGolomb(17),165301320,204002040,0.8103,19.4470,85,104,19 +9,4,24,AHasher,SwitchHash,ExpGolomb(17),165301930,204002040,0.8103,19.4471,85,104,19 +9,4,24,WyHash,CurrentHash,ExpGolomb(17),165305368,204006120,0.8103,19.4471,85,104,19 +9,4,24,WyHash,SwitchHash,ExpGolomb(17),165303470,204004080,0.8103,19.4471,85,104,19 +9,4,24,XxHash64,CurrentHash,ExpGolomb(17),165302774,204002040,0.8103,19.4472,85,104,19 +9,4,24,XxHash64,SwitchHash,ExpGolomb(17),165302302,204002040,0.8103,19.4471,85,104,19 +9,4,32,AHasher,CurrentHash,ExpGolomb(25),178411900,204800000,0.8712,27.8769,64,73,9 +9,4,32,AHasher,SwitchHash,ExpGolomb(25),178412970,204800000,0.8712,27.8770,64,73,9 +9,4,32,WyHash,CurrentHash,ExpGolomb(25),178418700,204800000,0.8712,27.8779,64,73,9 +9,4,32,WyHash,SwitchHash,ExpGolomb(25),178419106,204800000,0.8712,27.8780,64,73,9 +9,4,32,XxHash64,CurrentHash,ExpGolomb(25),178418174,204800000,0.8712,27.8778,64,73,9 +9,4,32,XxHash64,SwitchHash,ExpGolomb(25),178417576,204800000,0.8712,27.8777,64,73,9 +9,5,16,AHasher,CurrentHash,ExpGolomb(8),335984488,512000000,0.6562,10.4995,320,487,167 +9,5,16,AHasher,SwitchHash,ExpGolomb(8),335489764,512000000,0.6553,10.4841,320,488,168 +9,5,16,WyHash,CurrentHash,ExpGolomb(8),335989916,512000000,0.6562,10.4997,320,487,167 +9,5,16,WyHash,SwitchHash,ExpGolomb(8),335491796,512000000,0.6553,10.4841,320,488,168 +9,5,16,XxHash64,CurrentHash,ExpGolomb(8),335994592,512000000,0.6562,10.4998,320,487,167 +9,5,16,XxHash64,SwitchHash,ExpGolomb(8),335496312,512000000,0.6553,10.4843,320,488,168 +9,5,24,AHasher,CurrentHash,ExpGolomb(16),202713334,254417808,0.7968,19.1226,106,133,27 +9,5,24,AHasher,SwitchHash,ExpGolomb(16),202706184,254410176,0.7968,19.1225,106,133,27 +9,5,24,WyHash,CurrentHash,ExpGolomb(16),202713828,254415264,0.7968,19.1228,106,133,27 +9,5,24,WyHash,SwitchHash,ExpGolomb(16),202701628,254402544,0.7968,19.1226,106,133,27 +9,5,24,XxHash64,CurrentHash,ExpGolomb(16),202718556,254422896,0.7968,19.1227,106,133,27 +9,5,24,XxHash64,SwitchHash,ExpGolomb(16),202706608,254407632,0.7968,19.1227,106,133,27 +9,5,32,AHasher,CurrentHash,ExpGolomb(25),220272522,256000000,0.8604,27.5341,80,92,12 +9,5,32,AHasher,SwitchHash,ExpGolomb(25),220272620,256000000,0.8604,27.5341,80,92,12 +9,5,32,WyHash,CurrentHash,ExpGolomb(25),220275158,256000000,0.8604,27.5344,80,92,12 +9,5,32,WyHash,SwitchHash,ExpGolomb(25),220274486,256000000,0.8604,27.5343,80,92,12 +9,5,32,XxHash64,CurrentHash,ExpGolomb(25),220276306,256000000,0.8605,27.5345,80,92,12 +9,5,32,XxHash64,SwitchHash,ExpGolomb(25),220274800,256000000,0.8604,27.5343,80,92,12 +9,6,16,AHasher,SwitchHash,ExpGolomb(8),393080956,614400000,0.6398,10.2365,384,600,216 +9,6,16,WyHash,SwitchHash,ExpGolomb(8),393083492,614400000,0.6398,10.2365,384,600,216 +9,6,16,XxHash64,SwitchHash,ExpGolomb(8),393088060,614400000,0.6398,10.2367,384,600,216 +9,6,24,AHasher,CurrentHash,ExpGolomb(16),481652288,614400000,0.7839,18.8145,256,326,70 +9,6,24,AHasher,SwitchHash,ExpGolomb(16),240830786,307209216,0.7839,18.8143,128,163,35 +9,6,24,WyHash,CurrentHash,ExpGolomb(16),481663244,614400000,0.7840,18.8150,256,326,70 +9,6,24,WyHash,SwitchHash,ExpGolomb(16),240830172,307203072,0.7839,18.8147,128,163,35 +9,6,24,XxHash64,CurrentHash,ExpGolomb(16),481659052,614400000,0.7840,18.8148,256,326,70 +9,6,24,XxHash64,SwitchHash,ExpGolomb(16),240831916,307206144,0.7839,18.8146,128,163,35 +9,6,32,AHasher,CurrentHash,ExpGolomb(25),261886246,307200000,0.8525,27.2798,96,112,16 +9,6,32,AHasher,SwitchHash,ExpGolomb(25),261887554,307200000,0.8525,27.2800,96,112,16 +9,6,32,WyHash,CurrentHash,ExpGolomb(25),261888694,307200000,0.8525,27.2801,96,112,16 +9,6,32,WyHash,SwitchHash,ExpGolomb(25),261888282,307200000,0.8525,27.2800,96,112,16 +9,6,32,XxHash64,CurrentHash,ExpGolomb(25),261889116,307200000,0.8525,27.2801,96,112,16 +9,6,32,XxHash64,SwitchHash,ExpGolomb(25),261888200,307200000,0.8525,27.2800,96,112,16 +10,4,16,AHasher,CurrentHash,ExpGolomb(7),501502196,819200000,0.6122,9.7950,512,836,324 +10,4,16,AHasher,SwitchHash,ExpGolomb(7),500859080,819200000,0.6114,9.7824,512,837,325 +10,4,16,WyHash,CurrentHash,ExpGolomb(7),501510420,819200000,0.6122,9.7951,512,836,324 +10,4,16,WyHash,SwitchHash,ExpGolomb(7),500868024,819200000,0.6114,9.7826,512,837,325 +10,4,16,XxHash64,CurrentHash,ExpGolomb(7),501522480,819200000,0.6122,9.7954,512,836,324 +10,4,16,XxHash64,SwitchHash,ExpGolomb(7),500884880,819200000,0.6114,9.7829,512,837,325 +10,4,24,AHasher,CurrentHash,ExpGolomb(16),312748054,408016320,0.7665,18.3962,170,221,51 +10,4,24,AHasher,SwitchHash,ExpGolomb(16),312744180,408012240,0.7665,18.3962,170,221,51 +10,4,24,WyHash,CurrentHash,ExpGolomb(16),312738682,408004080,0.7665,18.3962,170,221,51 +10,4,24,WyHash,SwitchHash,ExpGolomb(16),312751442,408020400,0.7665,18.3962,170,221,51 +10,4,24,XxHash64,CurrentHash,ExpGolomb(16),312774010,408044880,0.7665,18.3964,170,221,51 +10,4,24,XxHash64,SwitchHash,ExpGolomb(16),312746244,408012240,0.7665,18.3963,170,221,51 +10,4,32,AHasher,CurrentHash,ExpGolomb(24),343222756,409600000,0.8379,26.8143,128,152,24 +10,4,32,AHasher,SwitchHash,ExpGolomb(24),343223712,409600000,0.8379,26.8144,128,152,24 +10,4,32,WyHash,CurrentHash,ExpGolomb(24),343228686,409600000,0.8380,26.8147,128,152,24 +10,4,32,WyHash,SwitchHash,ExpGolomb(24),343229134,409600000,0.8380,26.8148,128,152,24 +10,4,32,XxHash64,CurrentHash,ExpGolomb(24),343227206,409600000,0.8380,26.8146,128,152,24 +10,4,32,XxHash64,SwitchHash,ExpGolomb(24),343226920,409600000,0.8380,26.8146,128,152,24 +10,5,16,AHasher,SwitchHash,ExpGolomb(7),605100908,1024000000,0.5909,9.4547,640,1083,443 +10,5,16,WyHash,SwitchHash,ExpGolomb(7),605117004,1024000000,0.5909,9.4550,640,1083,443 +10,5,16,XxHash64,SwitchHash,ExpGolomb(7),605116024,1024000000,0.5909,9.4549,640,1083,443 +10,5,24,AHasher,CurrentHash,ExpGolomb(15),769765084,1022400000,0.7529,18.0696,426,565,139 +10,5,24,AHasher,SwitchHash,ExpGolomb(15),384889314,511210224,0.7529,18.0696,213,282,69 +10,5,24,WyHash,CurrentHash,ExpGolomb(15),769792940,1022400000,0.7529,18.0703,426,565,139 +10,5,24,WyHash,SwitchHash,ExpGolomb(15),384914154,511230672,0.7529,18.0700,213,282,69 +10,5,24,XxHash64,CurrentHash,ExpGolomb(15),769796280,1022400000,0.7529,18.0703,426,565,139 +10,5,24,XxHash64,SwitchHash,ExpGolomb(15),384899636,511205112,0.7529,18.0702,213,282,69 +10,5,32,AHasher,CurrentHash,ExpGolomb(24),423693706,512000000,0.8275,26.4809,160,193,33 +10,5,32,AHasher,SwitchHash,ExpGolomb(24),423694678,512000000,0.8275,26.4809,160,193,33 +10,5,32,WyHash,CurrentHash,ExpGolomb(24),423696036,512000000,0.8275,26.4810,160,193,33 +10,5,32,WyHash,SwitchHash,ExpGolomb(24),423695794,512000000,0.8275,26.4810,160,193,33 +10,5,32,XxHash64,CurrentHash,ExpGolomb(24),423698952,512000000,0.8275,26.4812,160,193,33 +10,5,32,XxHash64,SwitchHash,ExpGolomb(24),423697014,512000000,0.8275,26.4811,160,193,33 +10,6,24,AHasher,CurrentHash,ExpGolomb(15),910114344,1228800000,0.7407,17.7757,512,691,179 +10,6,24,AHasher,SwitchHash,ExpGolomb(15),910099224,1228800000,0.7406,17.7754,512,691,179 +10,6,24,WyHash,CurrentHash,ExpGolomb(15),910126388,1228800000,0.7407,17.7759,512,691,179 +10,6,24,WyHash,SwitchHash,ExpGolomb(15),910105804,1228800000,0.7406,17.7755,512,691,179 +10,6,24,XxHash64,CurrentHash,ExpGolomb(15),910137036,1228800000,0.7407,17.7761,512,691,179 +10,6,24,XxHash64,SwitchHash,ExpGolomb(15),910123952,1228800000,0.7407,17.7759,512,691,179 +10,6,32,AHasher,CurrentHash,ExpGolomb(24),503686750,614400000,0.8198,26.2337,192,234,42 +10,6,32,AHasher,SwitchHash,ExpGolomb(24),503686140,614400000,0.8198,26.2337,192,234,42 +10,6,32,WyHash,CurrentHash,ExpGolomb(24),503685284,614400000,0.8198,26.2336,192,234,42 +10,6,32,WyHash,SwitchHash,ExpGolomb(24),503686356,614400000,0.8198,26.2337,192,234,42 +10,6,32,XxHash64,CurrentHash,ExpGolomb(24),503684464,614400000,0.8198,26.2336,192,234,42 +10,6,32,XxHash64,SwitchHash,ExpGolomb(24),503684620,614400000,0.8198,26.2336,192,234,42 +11,4,24,AHasher,CurrentHash,ExpGolomb(15),1184000140,1636800000,0.7234,17.3607,682,942,260 +11,4,24,AHasher,SwitchHash,ExpGolomb(15),1183998504,1636800000,0.7234,17.3607,682,942,260 +11,4,24,WyHash,CurrentHash,ExpGolomb(15),1184013292,1636800000,0.7234,17.3609,682,942,260 +11,4,24,WyHash,SwitchHash,ExpGolomb(15),1184012140,1636800000,0.7234,17.3609,682,942,260 +11,4,24,XxHash64,CurrentHash,ExpGolomb(15),1184007400,1636800000,0.7234,17.3608,682,942,260 +11,4,24,XxHash64,SwitchHash,ExpGolomb(15),1184003132,1636800000,0.7234,17.3607,682,942,260 +11,4,32,AHasher,CurrentHash,ExpGolomb(23),659851632,819200000,0.8055,25.7755,256,317,61 +11,4,32,AHasher,SwitchHash,ExpGolomb(23),659850738,819200000,0.8055,25.7754,256,317,61 +11,4,32,WyHash,CurrentHash,ExpGolomb(23),659855516,819200000,0.8055,25.7756,256,317,61 +11,4,32,WyHash,SwitchHash,ExpGolomb(23),659854302,819200000,0.8055,25.7756,256,317,61 +11,4,32,XxHash64,CurrentHash,ExpGolomb(23),659859954,819208192,0.8055,25.7755,256,317,61 +11,4,32,XxHash64,SwitchHash,ExpGolomb(23),659853326,819200000,0.8055,25.7755,256,317,61 +11,5,24,AHasher,CurrentHash,ExpGolomb(14),1452061500,2044800000,0.7101,17.0430,852,1199,347 +11,5,24,AHasher,SwitchHash,ExpGolomb(14),1452038732,2044800000,0.7101,17.0427,852,1199,347 +11,5,24,WyHash,CurrentHash,ExpGolomb(14),1452079732,2044800000,0.7101,17.0432,852,1199,347 +11,5,24,WyHash,SwitchHash,ExpGolomb(14),1452053344,2044800000,0.7101,17.0429,852,1199,347 +11,5,24,XxHash64,CurrentHash,ExpGolomb(14),1452051728,2044800000,0.7101,17.0429,852,1199,347 +11,5,24,XxHash64,SwitchHash,ExpGolomb(14),1452043532,2044800000,0.7101,17.0428,852,1199,347 +11,5,32,AHasher,CurrentHash,ExpGolomb(23),814333540,1024000000,0.7952,25.4479,320,402,82 +11,5,32,AHasher,SwitchHash,ExpGolomb(23),814333562,1024000000,0.7952,25.4479,320,402,82 +11,5,32,WyHash,CurrentHash,ExpGolomb(23),814338294,1024000000,0.7953,25.4481,320,402,82 +11,5,32,WyHash,SwitchHash,ExpGolomb(23),814338072,1024000000,0.7953,25.4481,320,402,82 +11,5,32,XxHash64,CurrentHash,ExpGolomb(23),814335240,1024000000,0.7952,25.4480,320,402,82 +11,5,32,XxHash64,SwitchHash,ExpGolomb(23),814334692,1024000000,0.7952,25.4480,320,402,82 +11,6,24,AHasher,CurrentHash,ExpGolomb(14),1715461128,2457600000,0.6980,16.7526,1024,1467,443 +11,6,24,AHasher,SwitchHash,ExpGolomb(14),1715404520,2457600000,0.6980,16.7520,1024,1467,443 +11,6,24,WyHash,CurrentHash,ExpGolomb(14),1715488492,2457600000,0.6980,16.7528,1024,1466,442 +11,6,24,WyHash,SwitchHash,ExpGolomb(14),1715429368,2457600000,0.6980,16.7522,1024,1467,443 +11,6,24,XxHash64,CurrentHash,ExpGolomb(14),1715465700,2457600000,0.6980,16.7526,1024,1466,442 +11,6,24,XxHash64,SwitchHash,ExpGolomb(14),1715415900,2457600000,0.6980,16.7521,1024,1467,443 +11,6,32,AHasher,CurrentHash,ExpGolomb(23),967870334,1228800000,0.7877,25.2050,384,487,103 +11,6,32,AHasher,SwitchHash,ExpGolomb(23),967868928,1228800000,0.7877,25.2049,384,487,103 +11,6,32,WyHash,CurrentHash,ExpGolomb(23),967884944,1228812288,0.7877,25.2051,384,487,103 +11,6,32,WyHash,SwitchHash,ExpGolomb(23),967873918,1228800000,0.7877,25.2050,384,487,103 +11,6,32,XxHash64,CurrentHash,ExpGolomb(23),967870896,1228800000,0.7877,25.2050,384,487,103 +11,6,32,XxHash64,SwitchHash,ExpGolomb(23),967871178,1228800000,0.7877,25.2050,384,487,103 +12,4,24,AHasher,CurrentHash,ExpGolomb(14),2229077084,3273600000,0.6809,16.3422,1364,2003,639 +12,4,24,AHasher,SwitchHash,ExpGolomb(14),2229062612,3273600000,0.6809,16.3421,1364,2003,639 +12,4,24,WyHash,CurrentHash,ExpGolomb(14),2229085048,3273600000,0.6809,16.3423,1364,2003,639 +12,4,24,WyHash,SwitchHash,ExpGolomb(14),2229073452,3273600000,0.6809,16.3422,1364,2003,639 +12,4,24,XxHash64,CurrentHash,ExpGolomb(14),2229080708,3273600000,0.6809,16.3422,1364,2003,639 +12,4,24,XxHash64,SwitchHash,ExpGolomb(14),2229069628,3273600000,0.6809,16.3422,1364,2003,639 +12,4,32,AHasher,CurrentHash,ExpGolomb(22),1267300240,1638400000,0.7735,24.7520,512,661,149 +12,4,32,AHasher,SwitchHash,ExpGolomb(22),1267303354,1638400000,0.7735,24.7520,512,661,149 +12,4,32,WyHash,CurrentHash,ExpGolomb(22),1267310326,1638400000,0.7735,24.7522,512,661,149 +12,4,32,WyHash,SwitchHash,ExpGolomb(22),1267309364,1638400000,0.7735,24.7521,512,661,149 +12,4,32,XxHash64,CurrentHash,ExpGolomb(22),1267312866,1638400000,0.7735,24.7522,512,661,149 +12,4,32,XxHash64,SwitchHash,ExpGolomb(22),1267312064,1638400000,0.7735,24.7522,512,661,149 +12,5,24,AHasher,CurrentHash,ExpGolomb(13),2733937136,4094400000,0.6677,16.0254,1706,2554,848 +12,5,24,AHasher,SwitchHash,ExpGolomb(13),2733855924,4094400000,0.6677,16.0249,1706,2555,849 +12,5,24,WyHash,CurrentHash,ExpGolomb(13),2733914128,4094400000,0.6677,16.0253,1706,2554,848 +12,5,24,WyHash,SwitchHash,ExpGolomb(13),2733835244,4094400000,0.6677,16.0248,1706,2555,849 +12,5,24,XxHash64,CurrentHash,ExpGolomb(13),2733945440,4094400000,0.6677,16.0255,1706,2554,848 +12,5,24,XxHash64,SwitchHash,ExpGolomb(13),2733863796,4094400000,0.6677,16.0250,1706,2555,849 +12,5,32,AHasher,CurrentHash,ExpGolomb(22),1563408296,2048000000,0.7634,24.4283,640,838,198 +12,5,32,AHasher,SwitchHash,ExpGolomb(22),1563407500,2048000000,0.7634,24.4282,640,838,198 +12,5,32,WyHash,CurrentHash,ExpGolomb(22),1563418416,2048000000,0.7634,24.4284,640,838,198 +12,5,32,WyHash,SwitchHash,ExpGolomb(22),1563415970,2048000000,0.7634,24.4284,640,838,198 +12,5,32,XxHash64,CurrentHash,ExpGolomb(22),1563415910,2048000000,0.7634,24.4284,640,838,198 +12,5,32,XxHash64,SwitchHash,ExpGolomb(22),1563415172,2048000000,0.7634,24.4284,640,838,198 +12,6,24,AHasher,CurrentHash,ExpGolomb(13),3223473276,4915200000,0.6558,15.7396,2048,3122,1074 +12,6,24,AHasher,SwitchHash,ExpGolomb(13),3223262340,4915200000,0.6558,15.7386,2048,3123,1075 +12,6,24,WyHash,CurrentHash,ExpGolomb(13),3223465676,4915200000,0.6558,15.7396,2048,3122,1074 +12,6,24,WyHash,SwitchHash,ExpGolomb(13),3223242388,4915200000,0.6558,15.7385,2048,3123,1075 +12,6,24,XxHash64,CurrentHash,ExpGolomb(13),3223491192,4915200000,0.6558,15.7397,2048,3122,1074 +12,6,24,XxHash64,SwitchHash,ExpGolomb(13),3223254948,4915200000,0.6558,15.7385,2048,3123,1075 +12,6,32,AHasher,CurrentHash,ExpGolomb(22),1857662078,2457624576,0.7559,24.1881,768,1016,248 +12,6,32,AHasher,SwitchHash,ExpGolomb(22),1857640786,2457600000,0.7559,24.1880,768,1016,248 +12,6,32,WyHash,CurrentHash,ExpGolomb(22),1857664878,2457624576,0.7559,24.1881,768,1016,248 +12,6,32,WyHash,SwitchHash,ExpGolomb(22),1857644748,2457600000,0.7559,24.1881,768,1016,248 +12,6,32,XxHash64,CurrentHash,ExpGolomb(22),1857650678,2457600000,0.7559,24.1882,768,1016,248 +12,6,32,XxHash64,SwitchHash,ExpGolomb(22),1857649684,2457600000,0.7559,24.1881,768,1016,248 +13,4,24,AHasher,CurrentHash,ExpGolomb(13),4185263600,6552000000,0.6388,15.3306,2730,4273,1543 +13,4,24,AHasher,SwitchHash,ExpGolomb(13),4185223720,6552000000,0.6388,15.3305,2730,4273,1543 +13,4,24,WyHash,CurrentHash,ExpGolomb(13),4185245624,6552000000,0.6388,15.3306,2730,4273,1543 +13,4,24,WyHash,SwitchHash,ExpGolomb(13),4185208860,6552000000,0.6388,15.3304,2730,4273,1543 +13,4,24,XxHash64,CurrentHash,ExpGolomb(13),4185290040,6552000000,0.6388,15.3307,2730,4273,1543 +13,4,24,XxHash64,SwitchHash,ExpGolomb(13),4185243172,6552000000,0.6388,15.3306,2730,4273,1543 +13,4,32,AHasher,CurrentHash,ExpGolomb(21),2430807646,3276800000,0.7418,23.7384,1024,1380,356 +13,4,32,AHasher,SwitchHash,ExpGolomb(21),2430804588,3276800000,0.7418,23.7383,1024,1380,356 +13,4,32,WyHash,CurrentHash,ExpGolomb(21),2430807378,3276800000,0.7418,23.7384,1024,1380,356 +13,4,32,WyHash,SwitchHash,ExpGolomb(21),2430805502,3276800000,0.7418,23.7383,1024,1380,356 +13,4,32,XxHash64,CurrentHash,ExpGolomb(21),2430817812,3276800000,0.7418,23.7385,1024,1380,356 +13,4,32,XxHash64,SwitchHash,ExpGolomb(21),2430816150,3276800000,0.7418,23.7384,1024,1380,356 +13,5,24,AHasher,CurrentHash,ExpGolomb(12),5123733640,8188800000,0.6257,15.0168,3412,5453,2041 +13,5,24,AHasher,SwitchHash,ExpGolomb(12),5123436124,8188800000,0.6257,15.0159,3412,5453,2041 +13,5,24,WyHash,CurrentHash,ExpGolomb(12),5123740312,8188800000,0.6257,15.0168,3412,5453,2041 +13,5,24,WyHash,SwitchHash,ExpGolomb(12),5123418864,8188800000,0.6257,15.0159,3412,5453,2041 +13,5,24,XxHash64,CurrentHash,ExpGolomb(12),5123787736,8188800000,0.6257,15.0170,3412,5453,2041 +13,5,24,XxHash64,SwitchHash,ExpGolomb(12),5123480676,8188800000,0.6257,15.0161,3412,5453,2041 +13,5,32,AHasher,CurrentHash,ExpGolomb(21),2997407000,4096040960,0.7318,23.4170,1280,1749,469 +13,5,32,AHasher,SwitchHash,ExpGolomb(21),2997374028,4096000000,0.7318,23.4170,1280,1749,469 +13,5,32,WyHash,CurrentHash,ExpGolomb(21),2997399320,4096040960,0.7318,23.4169,1280,1749,469 +13,5,32,WyHash,SwitchHash,ExpGolomb(21),2997365848,4096000000,0.7318,23.4169,1280,1749,469 +13,5,32,XxHash64,CurrentHash,ExpGolomb(21),2997389918,4096000000,0.7318,23.4171,1280,1749,469 +13,5,32,XxHash64,SwitchHash,ExpGolomb(21),2997384488,4096000000,0.7318,23.4171,1280,1749,469 +13,6,24,AHasher,CurrentHash,ExpGolomb(12),6034593168,9830400000,0.6139,14.7329,4096,6672,2576 +13,6,24,AHasher,SwitchHash,ExpGolomb(12),6033709284,9830400000,0.6138,14.7307,4096,6673,2577 +13,6,24,WyHash,CurrentHash,ExpGolomb(12),6034613140,9830400000,0.6139,14.7329,4096,6672,2576 +13,6,24,WyHash,SwitchHash,ExpGolomb(12),6033732896,9830400000,0.6138,14.7308,4096,6673,2577 +13,6,24,XxHash64,CurrentHash,ExpGolomb(12),6034642804,9830400000,0.6139,14.7330,4096,6672,2576 +13,6,24,XxHash64,SwitchHash,ExpGolomb(12),6033765304,9830400000,0.6138,14.7309,4096,6673,2577 +13,6,32,AHasher,CurrentHash,ExpGolomb(21),3560195396,4915200000,0.7243,23.1784,1536,2120,584 +13,6,32,AHasher,SwitchHash,ExpGolomb(21),3560194814,4915200000,0.7243,23.1784,1536,2120,584 +13,6,32,WyHash,CurrentHash,ExpGolomb(21),3560188404,4915200000,0.7243,23.1783,1536,2120,584 +13,6,32,WyHash,SwitchHash,ExpGolomb(21),3560186274,4915200000,0.7243,23.1783,1536,2120,584 +13,6,32,XxHash64,CurrentHash,ExpGolomb(21),3560203832,4915200000,0.7243,23.1784,1536,2120,584 +13,6,32,XxHash64,SwitchHash,ExpGolomb(21),3560198580,4915200000,0.7243,23.1784,1536,2120,584 +14,4,24,AHasher,CurrentHash,ExpGolomb(12),7821390976,13104000000,0.5969,14.3249,5460,9147,3687 +14,4,24,AHasher,SwitchHash,ExpGolomb(12),7821222732,13104000000,0.5969,14.3246,5460,9147,3687 +14,4,24,WyHash,CurrentHash,ExpGolomb(12),7821377388,13104000000,0.5969,14.3249,5460,9147,3687 +14,4,24,WyHash,SwitchHash,ExpGolomb(12),7821203380,13104000000,0.5969,14.3245,5460,9147,3687 +14,4,24,XxHash64,CurrentHash,ExpGolomb(12),7821390140,13104000000,0.5969,14.3249,5460,9147,3687 +14,4,24,XxHash64,SwitchHash,ExpGolomb(12),7821239204,13104000000,0.5969,14.3246,5460,9147,3687 +14,4,32,AHasher,CurrentHash,ExpGolomb(20),4655225220,6553600000,0.7103,22.7306,2048,2883,835 +14,4,32,AHasher,SwitchHash,ExpGolomb(20),4655224016,6553600000,0.7103,22.7306,2048,2883,835 +14,4,32,WyHash,CurrentHash,ExpGolomb(20),4655208546,6553600000,0.7103,22.7305,2048,2883,835 +14,4,32,WyHash,SwitchHash,ExpGolomb(20),4655204246,6553600000,0.7103,22.7305,2048,2883,835 +14,4,32,XxHash64,CurrentHash,ExpGolomb(20),4655239876,6553600000,0.7103,22.7307,2048,2883,835 +14,4,32,XxHash64,SwitchHash,ExpGolomb(20),4655287366,6553665536,0.7103,22.7307,2048,2883,835 +14,5,24,AHasher,CurrentHash,ExpGolomb(11),9564895384,16382400000,0.5839,14.0124,6826,11691,4865 +14,5,24,AHasher,SwitchHash,ExpGolomb(11),9563613400,16382400000,0.5838,14.0106,6826,11692,4866 +14,5,24,WyHash,CurrentHash,ExpGolomb(11),9564895292,16382400000,0.5839,14.0124,6826,11691,4865 +14,5,24,WyHash,SwitchHash,ExpGolomb(11),9563613440,16382400000,0.5838,14.0106,6826,11692,4866 +14,5,24,XxHash64,CurrentHash,ExpGolomb(11),9564827676,16382400000,0.5838,14.0123,6826,11691,4865 +14,5,24,XxHash64,SwitchHash,ExpGolomb(11),9563564180,16382400000,0.5838,14.0105,6826,11692,4866 +14,5,32,AHasher,CurrentHash,ExpGolomb(20),5737180262,8192081920,0.7003,22.4106,2560,3655,1095 +14,5,32,AHasher,SwitchHash,ExpGolomb(20),5737173226,8192081920,0.7003,22.4106,2560,3655,1095 +14,5,32,WyHash,CurrentHash,ExpGolomb(20),5737168448,8192081920,0.7003,22.4106,2560,3655,1095 +14,5,32,WyHash,SwitchHash,ExpGolomb(20),5737161998,8192081920,0.7003,22.4106,2560,3655,1095 +14,5,32,XxHash64,CurrentHash,ExpGolomb(20),5737118404,8192000000,0.7003,22.4106,2560,3655,1095 +14,5,32,XxHash64,SwitchHash,ExpGolomb(20),5737119444,8192000000,0.7003,22.4106,2560,3655,1095 +14,6,24,AHasher,CurrentHash,ExpGolomb(11),11248414420,19660800000,0.5721,13.7310,8192,14318,6126 +14,6,24,AHasher,SwitchHash,ExpGolomb(11),11244899904,19660800000,0.5719,13.7267,8192,14323,6131 +14,6,24,WyHash,CurrentHash,ExpGolomb(11),11248432572,19660800000,0.5721,13.7310,8192,14318,6126 +14,6,24,WyHash,SwitchHash,ExpGolomb(11),11244885292,19660800000,0.5719,13.7267,8192,14323,6131 +14,6,24,XxHash64,CurrentHash,ExpGolomb(11),11248344900,19660800000,0.5721,13.7309,8192,14318,6126 +14,6,24,XxHash64,SwitchHash,ExpGolomb(11),11244817876,19660800000,0.5719,13.7266,8192,14323,6131 +14,6,32,AHasher,CurrentHash,ExpGolomb(20),6811570744,9830498304,0.6929,22.1729,3072,4433,1361 +14,6,32,AHasher,SwitchHash,ExpGolomb(20),6811503870,9830400000,0.6929,22.1729,3072,4433,1361 +14,6,32,WyHash,CurrentHash,ExpGolomb(20),6811643772,9830596608,0.6929,22.1729,3072,4433,1361 +14,6,32,WyHash,SwitchHash,ExpGolomb(20),6811500914,9830400000,0.6929,22.1729,3072,4433,1361 +14,6,32,XxHash64,CurrentHash,ExpGolomb(20),6811570152,9830498304,0.6929,22.1729,3072,4433,1361 +14,6,32,XxHash64,SwitchHash,ExpGolomb(20),6811505724,9830400000,0.6929,22.1729,3072,4433,1361 +15,4,24,AHasher,CurrentHash,ExpGolomb(11),14550049376,26212800000,0.5551,13.3218,10922,19676,8754 +15,4,24,AHasher,SwitchHash,ExpGolomb(11),14549412556,26212800000,0.5550,13.3212,10922,19677,8755 +15,4,24,WyHash,CurrentHash,ExpGolomb(11),14550052652,26212800000,0.5551,13.3218,10922,19676,8754 +15,4,24,WyHash,SwitchHash,ExpGolomb(11),14549384164,26212800000,0.5550,13.3212,10922,19677,8755 +15,4,24,XxHash64,CurrentHash,ExpGolomb(11),14550046972,26212800000,0.5551,13.3218,10922,19676,8754 +15,4,24,XxHash64,SwitchHash,ExpGolomb(11),14549385248,26212800000,0.5550,13.3212,10922,19677,8755 +15,4,32,AHasher,CurrentHash,ExpGolomb(19),8899239538,13107462144,0.6789,21.7262,4096,6033,1937 +15,4,32,AHasher,SwitchHash,ExpGolomb(19),8899058204,13107200000,0.6789,21.7262,4096,6032,1936 +15,4,32,WyHash,CurrentHash,ExpGolomb(19),8899062878,13107200000,0.6789,21.7262,4096,6032,1936 +15,4,32,WyHash,SwitchHash,ExpGolomb(19),8899062884,13107200000,0.6789,21.7262,4096,6032,1936 +15,4,32,XxHash64,CurrentHash,ExpGolomb(19),8899044714,13107200000,0.6789,21.7262,4096,6032,1936 +15,4,32,XxHash64,SwitchHash,ExpGolomb(19),8899040920,13107200000,0.6789,21.7262,4096,6032,1936 +15,5,24,AHasher,CurrentHash,ExpGolomb(10),17763866892,32764800000,0.5422,13.0119,13652,25180,11528 +15,5,24,AHasher,SwitchHash,ExpGolomb(10),17758654360,32764800000,0.5420,13.0081,13652,25188,11536 +15,5,24,WyHash,CurrentHash,ExpGolomb(10),17763947080,32764800000,0.5422,13.0120,13652,25180,11528 +15,5,24,WyHash,SwitchHash,ExpGolomb(10),17758753204,32764800000,0.5420,13.0082,13652,25187,11535 +15,5,24,XxHash64,CurrentHash,ExpGolomb(10),17763882400,32764800000,0.5422,13.0119,13652,25180,11528 +15,5,24,XxHash64,SwitchHash,ExpGolomb(10),17758698704,32764800000,0.5420,13.0081,13652,25187,11535 +15,5,32,AHasher,CurrentHash,ExpGolomb(19),10960492192,16384163840,0.6690,21.4070,5120,7653,2533 +15,5,32,AHasher,SwitchHash,ExpGolomb(19),10960494464,16384163840,0.6690,21.4070,5120,7653,2533 +15,5,32,WyHash,CurrentHash,ExpGolomb(19),10960820706,16384655360,0.6690,21.4070,5120,7653,2533 +15,5,32,WyHash,SwitchHash,ExpGolomb(19),10960379168,16384000000,0.6690,21.4070,5120,7653,2533 +15,5,32,XxHash64,CurrentHash,ExpGolomb(19),10960364684,16384000000,0.6690,21.4070,5120,7653,2533 +15,5,32,XxHash64,SwitchHash,ExpGolomb(19),10960364224,16384000000,0.6690,21.4070,5120,7653,2533 +15,6,24,AHasher,CurrentHash,ExpGolomb(10),20862254536,39321600000,0.5306,12.7333,16384,30880,14496 +15,6,24,AHasher,SwitchHash,ExpGolomb(10),20848061232,39321600000,0.5302,12.7246,16384,30901,14517 +15,6,24,WyHash,CurrentHash,ExpGolomb(10),20862241512,39321600000,0.5306,12.7333,16384,30880,14496 +15,6,24,WyHash,SwitchHash,ExpGolomb(10),20848106724,39321600000,0.5302,12.7247,16384,30901,14517 +15,6,24,XxHash64,CurrentHash,ExpGolomb(10),20862232768,39321600000,0.5306,12.7333,16384,30880,14496 +15,6,24,XxHash64,SwitchHash,ExpGolomb(10),20848075308,39321600000,0.5302,12.7247,16384,30901,14517 +15,6,32,AHasher,CurrentHash,ExpGolomb(19),13006987336,19661193216,0.6616,21.1698,6144,9287,3143 +15,6,32,AHasher,SwitchHash,ExpGolomb(19),13006725710,19660800000,0.6616,21.1698,6144,9287,3143 +15,6,32,WyHash,CurrentHash,ExpGolomb(19),13007247604,19661586432,0.6616,21.1698,6144,9287,3143 +15,6,32,WyHash,SwitchHash,ExpGolomb(19),13006717476,19660800000,0.6616,21.1698,6144,9287,3143 +15,6,32,XxHash64,CurrentHash,ExpGolomb(19),13006979088,19661193216,0.6616,21.1698,6144,9287,3143 +15,6,32,XxHash64,SwitchHash,ExpGolomb(19),13007100036,19661389824,0.6616,21.1698,6144,9287,3143 +16,4,24,AHasher,CurrentHash,ExpGolomb(10),26914112408,52425600000,0.5134,12.3211,21844,42549,20705 +16,4,24,AHasher,SwitchHash,ExpGolomb(10),26911171688,52425600000,0.5133,12.3197,21844,42554,20710 +16,4,24,WyHash,CurrentHash,ExpGolomb(10),26914104680,52425600000,0.5134,12.3211,21844,42549,20705 +16,4,24,WyHash,SwitchHash,ExpGolomb(10),26911132044,52425600000,0.5133,12.3197,21844,42554,20710 +16,4,24,XxHash64,CurrentHash,ExpGolomb(10),26914079816,52425600000,0.5134,12.3210,21844,42549,20705 +16,4,24,XxHash64,SwitchHash,ExpGolomb(10),26911132388,52425600000,0.5133,12.3197,21844,42554,20710 +16,4,32,AHasher,CurrentHash,ExpGolomb(18),16976919986,26214400000,0.6476,20.7238,8192,12649,4457 +16,4,32,AHasher,SwitchHash,ExpGolomb(18),16976925226,26214400000,0.6476,20.7238,8192,12649,4457 +16,4,32,WyHash,CurrentHash,ExpGolomb(18),16977416668,26215186432,0.6476,20.7238,8192,12649,4457 +16,4,32,WyHash,SwitchHash,ExpGolomb(18),16976885944,26214400000,0.6476,20.7237,8192,12649,4457 +16,4,32,XxHash64,CurrentHash,ExpGolomb(18),16977079728,26214662144,0.6476,20.7238,8192,12649,4457 +16,4,32,XxHash64,SwitchHash,ExpGolomb(18),16977244240,26214924288,0.6476,20.7238,8192,12649,4457 +16,5,24,AHasher,CurrentHash,ExpGolomb(9),32808225372,65534400000,0.5006,12.0150,27306,54543,27237 +16,5,24,AHasher,SwitchHash,ExpGolomb(9),32787152672,65534400000,0.5003,12.0073,27306,54578,27272 +16,5,24,WyHash,CurrentHash,ExpGolomb(9),32808196692,65534400000,0.5006,12.0150,27306,54543,27237 +16,5,24,WyHash,SwitchHash,ExpGolomb(9),32787146408,65534400000,0.5003,12.0073,27306,54578,27272 +16,5,24,XxHash64,CurrentHash,ExpGolomb(9),32808207840,65534400000,0.5006,12.0150,27306,54543,27237 +16,5,24,XxHash64,SwitchHash,ExpGolomb(9),32787134836,65534400000,0.5003,12.0073,27306,54578,27272 +16,5,32,AHasher,CurrentHash,ExpGolomb(18),20895574858,32769310720,0.6377,20.4050,10240,16059,5819 +16,5,32,AHasher,SwitchHash,ExpGolomb(18),20895139956,32768655360,0.6377,20.4050,10240,16059,5819 +16,5,32,WyHash,CurrentHash,ExpGolomb(18),20895540556,32769310720,0.6377,20.4050,10240,16059,5819 +16,5,32,WyHash,SwitchHash,ExpGolomb(18),20894690332,32768000000,0.6377,20.4050,10240,16058,5818 +16,5,32,XxHash64,CurrentHash,ExpGolomb(18),20895135172,32768655360,0.6377,20.4050,10240,16059,5819 +16,5,32,XxHash64,SwitchHash,ExpGolomb(18),20895117446,32768655360,0.6377,20.4050,10240,16059,5819 +16,6,24,AHasher,SwitchHash,ExpGolomb(9),38417808760,78643200000,0.4885,11.7242,32768,67077,34309 +16,6,24,WyHash,SwitchHash,ExpGolomb(9),38417832480,78643200000,0.4885,11.7242,32768,67077,34309 +16,6,24,XxHash64,SwitchHash,ExpGolomb(9),38417825712,78643200000,0.4885,11.7242,32768,67077,34309 +16,6,32,AHasher,CurrentHash,ExpGolomb(18),49565193412,78643200000,0.6303,20.1681,24576,38993,14417 +16,6,32,AHasher,SwitchHash,ExpGolomb(18),24782815576,39321993216,0.6303,20.1681,12288,19497,7209 +16,6,32,WyHash,CurrentHash,ExpGolomb(18),49565199548,78643200000,0.6303,20.1681,24576,38993,14417 +16,6,32,WyHash,SwitchHash,ExpGolomb(18),24782566714,39321600000,0.6303,20.1681,12288,19496,7208 +16,6,32,XxHash64,CurrentHash,ExpGolomb(18),49565165380,78643200000,0.6303,20.1681,24576,38993,14417 +16,6,32,XxHash64,SwitchHash,ExpGolomb(18),24782547966,39321600000,0.6303,20.1681,12288,19496,7208 +17,4,24,AHasher,SwitchHash,ExpGolomb(9),49454432780,104856000000,0.4716,11.3194,43690,92633,48943 +17,4,24,WyHash,SwitchHash,ExpGolomb(9),49454399460,104856000000,0.4716,11.3194,43690,92633,48943 +17,4,24,XxHash64,SwitchHash,ExpGolomb(9),49454456124,104856000000,0.4716,11.3194,43690,92633,48943 +17,4,32,AHasher,CurrentHash,ExpGolomb(17),64626491500,104857600000,0.6163,19.7224,32768,53166,20398 +17,4,32,AHasher,SwitchHash,ExpGolomb(17),32313222620,52428800000,0.6163,19.7224,16384,26583,10199 +17,4,32,WyHash,CurrentHash,ExpGolomb(17),64626476500,104857600000,0.6163,19.7224,32768,53166,20398 +17,4,32,WyHash,SwitchHash,ExpGolomb(17),32313225742,52428800000,0.6163,19.7224,16384,26583,10199 +17,4,32,XxHash64,CurrentHash,ExpGolomb(17),64626459312,104857600000,0.6163,19.7224,32768,53166,20398 +17,4,32,XxHash64,SwitchHash,ExpGolomb(17),32313525648,52429324288,0.6163,19.7224,16384,26583,10199 +17,5,24,AHasher,SwitchHash,ExpGolomb(8),60117793024,131068800000,0.4587,11.0082,54612,119065,64453 +17,5,24,WyHash,SwitchHash,ExpGolomb(8),60117611252,131068800000,0.4587,11.0081,54612,119065,64453 +17,5,24,XxHash64,SwitchHash,ExpGolomb(8),60117749148,131068800000,0.4587,11.0082,54612,119065,64453 +17,5,32,AHasher,CurrentHash,ExpGolomb(17),79478464140,131072000000,0.6064,19.4039,40960,67549,26589 +17,5,32,AHasher,SwitchHash,ExpGolomb(17),39739561878,65536655360,0.6064,19.4039,20480,33775,13295 +17,5,32,WyHash,CurrentHash,ExpGolomb(17),79478352748,131072000000,0.6064,19.4039,40960,67549,26589 +17,5,32,WyHash,SwitchHash,ExpGolomb(17),39739535048,65536655360,0.6064,19.4039,20480,33775,13295 +17,5,32,XxHash64,CurrentHash,ExpGolomb(17),79478399964,131072000000,0.6064,19.4039,40960,67549,26589 +17,5,32,XxHash64,SwitchHash,ExpGolomb(17),39739143754,65536000000,0.6064,19.4039,20480,33774,13294 +17,6,24,AHasher,SwitchHash,ExpGolomb(8),70288808932,157286400000,0.4469,10.7252,65536,146650,81114 +17,6,24,WyHash,SwitchHash,ExpGolomb(8),70288610544,157286400000,0.4469,10.7252,65536,146651,81115 +17,6,24,XxHash64,SwitchHash,ExpGolomb(8),70288696812,157286400000,0.4469,10.7252,65536,146651,81115 +17,6,32,AHasher,CurrentHash,ExpGolomb(17),94210670016,157286400000,0.5990,19.1672,49152,82060,32908 +17,6,32,AHasher,SwitchHash,ExpGolomb(17),47105198300,78643200000,0.5990,19.1672,24576,41030,16454 +17,6,32,WyHash,CurrentHash,ExpGolomb(17),94210614284,157286400000,0.5990,19.1672,49152,82060,32908 +17,6,32,WyHash,SwitchHash,ExpGolomb(17),47105183384,78643200000,0.5990,19.1671,24576,41030,16454 +17,6,32,XxHash64,CurrentHash,ExpGolomb(17),94210676364,157286400000,0.5990,19.1672,49152,82060,32908 +17,6,32,XxHash64,SwitchHash,ExpGolomb(17),47106610738,78645559296,0.5990,19.1672,24576,41031,16455 +18,4,24,AHasher,SwitchHash,ExpGolomb(8),90180088392,209712000000,0.4300,10.3204,87380,203200,115820 +18,4,24,WyHash,SwitchHash,ExpGolomb(8),90180086812,209712000000,0.4300,10.3204,87380,203200,115820 +18,4,24,XxHash64,SwitchHash,ExpGolomb(8),90180159568,209712000000,0.4300,10.3205,87380,203200,115820 +18,4,32,AHasher,CurrentHash,ExpGolomb(16),122694719448,209715200000,0.5851,18.7217,65536,112017,46481 +18,4,32,AHasher,SwitchHash,ExpGolomb(16),61349143416,104860745728,0.5851,18.7217,32768,56010,23242 +18,4,32,WyHash,CurrentHash,ExpGolomb(16),122694527488,209715200000,0.5851,18.7217,65536,112017,46481 +18,4,32,WyHash,SwitchHash,ExpGolomb(16),61349049244,104860745728,0.5851,18.7217,32768,56010,23242 +18,4,32,XxHash64,CurrentHash,ExpGolomb(16),122694718440,209715200000,0.5851,18.7217,65536,112017,46481 +18,4,32,XxHash64,SwitchHash,ExpGolomb(16),61348563104,104859697152,0.5851,18.7217,32768,56009,23241 +18,5,24,XxHash64,SwitchHash,ExpGolomb(7),109347445792,262142400000,0.4171,10.0111,109226,261851,152625 +18,5,32,XxHash64,CurrentHash,ExpGolomb(16),150760362356,262144000000,0.5751,18.4034,81920,142443,60523 +18,5,32,XxHash64,SwitchHash,ExpGolomb(16),75383730406,131078553600,0.5751,18.4033,40962,71225,30263 +18,6,32,XxHash64,CurrentHash,ExpGolomb(16),178586869256,314572800000,0.5677,18.1668,98304,173158,74854 +18,6,32,XxHash64,SwitchHash,ExpGolomb(16),178585717360,314572800000,0.5677,18.1667,98304,173159,74855 diff --git a/optimal-gap-codes/src/main.rs b/optimal-gap-codes/src/main.rs index 9bce6fc..080c574 100644 --- a/optimal-gap-codes/src/main.rs +++ b/optimal-gap-codes/src/main.rs @@ -3,22 +3,38 @@ #![deny(unsafe_code)] #![deny(unused_macro_rules)] #![deny(missing_docs)] +extern crate prettyplease; +extern crate proc_macro2; +extern crate quote; +extern crate syn; + +use prettyplease::unparse; +use proc_macro2::TokenStream; +use quote::quote; +use syn::{File, Ident}; use dsi_bitstream::prelude::{Code, CodesStats}; -use hyperloglog_rs::composite_hash::{switch::SwitchHash, CompositeHash}; +use hyperloglog_rs::composite_hash::{current::CurrentHash, switch::SwitchHash, CompositeHash}; use hyperloglog_rs::prelude::*; use indicatif::MultiProgress; use indicatif::{ParallelProgressIterator, ProgressBar, ProgressStyle}; use rayon::prelude::*; -use serde::Deserialize; use serde::Serialize; +use serde::{Deserialize, Serializer}; use std::collections::HashMap; use test_utils::prelude::{append_csv, read_csv, write_csv}; use twox_hash::XxHash64; +fn float_formatter(value: &f64, serializer: S) -> Result +where + S: Serializer, +{ + serializer.serialize_str(&format!("{value:.4}")) +} + type CS = CodesStats<50, 50, 50, 50, 50>; -#[derive(Debug, Serialize, Deserialize, PartialEq, PartialOrd)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, PartialOrd)] /// Report of the gap between subsequent hashes in the Listhash variant of HyperLogLog. struct GapReport { /// The precision exponent of the HyperLogLog, determining @@ -42,9 +58,92 @@ struct GapReport { /// The uncompressed space usage if no code was used. uncompressed_space_usage: u64, /// The rate of the optimal code. + #[serde(serialize_with = "float_formatter")] rate: f64, /// Mean encoded gap size in bits. + #[serde(serialize_with = "float_formatter")] mean_gap_size: f64, + /// The number of hashes that can fit without the optimal code. + number_of_hashes: u64, + /// The number of hashes that can fit with the optimal code. + number_of_hashes_with_code: u64, + /// Number of extra hashes that can fit with the optimal code and not + /// without it. + extra_hashes: u64, +} + +impl GapReport { + fn as_prefix_free_code_impl(&self) -> TokenStream { + let precision = Ident::new( + &format!("Precision{}", self.precision), + proc_macro2::Span::call_site(), + ); + let bits = Ident::new( + &format!("Bits{}", self.bit_size), + proc_macro2::Span::call_site(), + ); + let code = Ident::new( + &self.code.split("(").next().unwrap(), + proc_macro2::Span::call_site(), + ); + let code = if self.code.contains("(") { + let number = self + .code + .split("(") + .last() + .unwrap() + .split(")") + .next() + .unwrap(); + let number_usize = number.parse::().unwrap(); + + quote! { #code<#number_usize> } + } else { + quote! { #code } + }; + + let hash_size = self.hash_size; + let composite_hash = Ident::new(&self.composite_hash, proc_macro2::Span::call_site()); + + let precision_flag = format!("precision_{}", self.precision); + + quote! { + #[cfg(feature = #precision_flag)] + impl super::PrefixFreeCode<#hash_size> for crate::composite_hash::#composite_hash { + type Code = super::prefix_free_codes::#code; + } + } + } + + fn as_test_only_prefix_free_code_impl( + precision: u8, + bit_size: u8, + hash_size: u8, + composite_hash: &str, + ) -> TokenStream { + + let bits = Ident::new( + &format!("Bits{}", bit_size), + proc_macro2::Span::call_site(), + ); + + let hash_size = hash_size; + let composite_hash = Ident::new(&composite_hash, proc_macro2::Span::call_site()); + + let precision_flag = format!("precision_{}", precision); + let precision = Ident::new( + &format!("Precision{}", precision), + proc_macro2::Span::call_site(), + ); + + quote! { + #[cfg(feature = #precision_flag)] + #[cfg(test)] + impl super::PrefixFreeCode<#hash_size> for crate::composite_hash::#composite_hash { + type Code = super::prefix_free_codes::NoPrefixCode<#hash_size>; + } + } + } } /// Normalized the name of a hasher type. @@ -86,7 +185,7 @@ fn optimal_gap_codes< } } - let iterations = 50_000; + let iterations = 100_000; let hll = Hybrid::>::Packed, H>, CH>::default(); let progress_bar = multiprogress.add(ProgressBar::new(iterations as u64)); @@ -117,14 +216,12 @@ fn optimal_gap_codes< let hash_size = hll.hash_bytes() * 8; let mut last_hash: Option = None; for hash in hll.hashes().unwrap() { - if let Some(last_hash) = last_hash { - assert!(last_hash >= hash); - let entry = gap_report - .entry(hash_size) - .or_insert_with(|| (CS::default(), 0)); - entry.0.update(last_hash - hash); - entry.1 += 1; - } + let gap = last_hash.map(|last_hash| last_hash - hash).unwrap_or(hash); + let entry = gap_report + .entry(hash_size) + .or_insert_with(|| (CS::default(), 0)); + entry.0.update(gap); + entry.1 += 1; last_hash = Some(hash); } } @@ -133,14 +230,12 @@ fn optimal_gap_codes< let hash_size = hll.hash_bytes() * 8; let mut last_hash: Option = None; for hash in hll.hashes().unwrap() { - if let Some(last_hash) = last_hash { - assert!(last_hash >= hash); - let entry = gap_report - .entry(hash_size) - .or_insert_with(|| (CS::default(), 0)); - entry.0.update(last_hash - hash); - entry.1 += 1; - } + let gap = last_hash.map(|last_hash| last_hash - hash).unwrap_or(hash); + let entry = gap_report + .entry(hash_size) + .or_insert_with(|| (CS::default(), 0)); + entry.0.update(gap); + entry.1 += 1; last_hash = Some(hash); } break; @@ -152,9 +247,7 @@ fn optimal_gap_codes< || HashMap::new(), |mut acc, report| { for (hash_size, (gap_report, total)) in report { - let hash_size_report = acc - .entry(hash_size) - .or_insert_with(|| (CS::default(), 0)); + let hash_size_report = acc.entry(hash_size).or_insert_with(|| (CS::default(), 0)); hash_size_report.0 += gap_report; hash_size_report.1 += total; } @@ -168,9 +261,13 @@ fn optimal_gap_codes< gaps.iter().map(|(hash_size, (gap_report, total))| { let (code, space_usage): (Code, u64) = gap_report.best_code(); - let uncompressed_space_usage = u64::from(*hash_size) * (total + 1); + let uncompressed_space_usage = u64::from(*hash_size) * *total as u64; let rate = space_usage as f64 / uncompressed_space_usage as f64; let mean_gap_size = space_usage as f64 / *total as f64; + let number_of_hashes = *total / iterations; + let number_of_hashes_with_code = + (uncompressed_space_usage as f64 / mean_gap_size / iterations as f64) as u64; + let extra_hashes = number_of_hashes_with_code.saturating_sub(number_of_hashes); GapReport { precision: P::EXPONENT, @@ -182,7 +279,10 @@ fn optimal_gap_codes< space_usage, uncompressed_space_usage, rate, - mean_gap_size + mean_gap_size, + number_of_hashes, + number_of_hashes_with_code, + extra_hashes, } }), path, @@ -193,25 +293,25 @@ fn optimal_gap_codes< /// bit size and hasher types. macro_rules! generate_optimal_gap_codes { ($multiprogress:ident, $precision:ty, $bit_size:ty, $($hasher:ty),*) => { - // let progress_bar = $multiprogress.add(ProgressBar::new(1 as u64)); + let progress_bar = $multiprogress.add(ProgressBar::new(2 as u64)); - // progress_bar.set_style( - // ProgressStyle::default_bar() - // .template("[{elapsed_precise} | {eta}] {bar:40.cyan/blue} {pos:>7}/{len:7} {msg}") - // .unwrap() - // .progress_chars("##-"), - // ); + progress_bar.set_style( + ProgressStyle::default_bar() + .template("[{elapsed_precise} | {eta}] {bar:40.cyan/blue} {pos:>7}/{len:7} {msg}") + .unwrap() + .progress_chars("##-"), + ); - // progress_bar.tick(); + progress_bar.tick(); $( - // optimal_gap_codes::<$precision, $bit_size, $hasher, CurrentHash<$precision, $bit_size>>($multiprogress); - // progress_bar.inc(1); + optimal_gap_codes::<$precision, $bit_size, $hasher, CurrentHash<$precision, $bit_size>>($multiprogress); + progress_bar.inc(1); optimal_gap_codes::<$precision, $bit_size, $hasher, SwitchHash<$precision, $bit_size>>($multiprogress); - // progress_bar.inc(1); + progress_bar.inc(1); )* - // progress_bar.finish_and_clear(); + progress_bar.finish_and_clear(); }; } @@ -290,4 +390,72 @@ fn main() { reports.sort_by(|a, b| a.partial_cmp(b).unwrap_or(std::cmp::Ordering::Equal)); write_csv(reports.iter(), "optimal-gap-codes.csv"); + + // Next, we generate the implementation of the PrefixFreeCode trait for the optimal codes. + // Of all reports, we keep only the first one we encounter for each combination of precision, + // bit size, hash size and composite hash. + let reports = reports + .into_iter() + .filter(|report| { + // If the report shows that the optimal code achieves less than 1 extra hash, we do not + // generate the implementation. + report.extra_hashes > 0 + }) + .fold(HashMap::new(), |mut acc, report| { + let key = ( + report.precision, + report.bit_size, + report.hash_size, + report.composite_hash.clone(), + ); + acc.entry(key).or_insert(report); + acc + }); + + let valid_impls = reports + .iter() + .map(|(_, report)| report.as_prefix_free_code_impl()); + + + let test_impls = (4..=18) + .flat_map(|precision| { + [4, 5, 6].map(|bits| (precision, bits)) + }) + .flat_map(|(precision, bits)|{ + [8, 16, 24, 32].map(|hash_size|{ + (precision, bits, hash_size) + }) + }) + .flat_map(|(precision, bits, hash_size)|{ + ["CurrentHash", "SwitchHash"].map(move |composite_hash| { + (precision, bits, hash_size, composite_hash) + }) + }).filter(|(precision, bits, hash_size, composite_hash)| { + !reports.contains_key(&(*precision, *bits, *hash_size, composite_hash.to_string())) + }).map(|(precision, bits, hash_size, composite_hash)| { + GapReport::as_test_only_prefix_free_code_impl(precision, bits, hash_size, composite_hash) + }); + + let output = quote! { + #(#valid_impls)* + + #(#test_impls)* + }; + + // We write out the output token stream to '../src/composite_hash/gaps/optimal_codes.rs'. + let output_path = "../src/composite_hash/gaps/optimal_codes.rs"; + + // Convert the generated TokenStream to a string + let code_string = output.to_string(); + + // Parse the generated code string into a syn::Item + let syntax_tree: File = syn::parse_str(&code_string).unwrap(); + + // Use prettyplease to format the syntax tree + let formatted_code = unparse(&syntax_tree); + + // Write the formatted code to the output file + std::fs::write(output_path, formatted_code).unwrap(); + + println!("Generated optimal codes in '{}'", output_path); } diff --git a/src/composite_hash.rs b/src/composite_hash.rs index 31ae5db..4d783b4 100644 --- a/src/composite_hash.rs +++ b/src/composite_hash.rs @@ -6,6 +6,8 @@ pub mod current; pub mod gaps; mod shared; pub mod switch; +pub use current::CurrentHash; +pub use switch::SwitchHash; /// A composite hash is a 64-bit hash that encodes a register, index and original hash. pub trait CompositeHash: Send + Sync { @@ -127,6 +129,7 @@ mod test_composite_hash { use super::*; use crate::prelude::*; + use gaps::PrefixFreeCode; use hyperloglog_derive::test_precisions_and_bits; /// Adds the register as leading number of zeros and the index as the tail of the hash @@ -170,6 +173,7 @@ mod test_composite_hash { ) } + #[allow(unsafe_code)] fn test_composite_hash() { let maximal_register_value = 1 << CH::Bits::NUMBER_OF_BITS; let maximal_index_value = 1 << CH::Precision::EXPONENT; @@ -182,7 +186,14 @@ mod test_composite_hash { number_of_hashes * number_of_indices_to_sample * (maximal_register_value - 1); let mut reference_hashes: Vec = Vec::with_capacity(number_of_expected_hashes); let mut encoded_hashes = - vec![0_u8; number_of_expected_hashes * usize::from(hash_bytes)]; + vec![0_u64; ceil(number_of_expected_hashes * usize::from(hash_bytes), 8)]; + let mut encoded_hashes: &mut [u8] = unsafe { + core::slice::from_raw_parts_mut( + encoded_hashes.as_mut_ptr() as *mut u8, + encoded_hashes.len() * 8, + ) + }; + random_state = splitmix64(random_state); for index in iter_random_values::( number_of_indices_to_sample as u64, @@ -210,7 +221,7 @@ mod test_composite_hash { assert_eq!(index, decoded_index, "Failed to recover the index at hash bits {hash_bits}. The hash is {encoded_hash:b}. The fake hash is {fake_hash:064b}."); match CH::find( - encoded_hashes.as_slice(), + encoded_hashes, reference_hashes.len(), index, register, @@ -271,13 +282,26 @@ mod test_composite_hash { ); } else { // If the hash was not inserted, there must be a reference stored with the same hash. - assert_eq!(reference_hashes.contains(&encoded_hash), true); + assert_eq!( + reference_hashes.contains(&encoded_hash), true, + concat!( + "The hash was not found in the reference hashes, but it is in the encoded hashes. ", + "The register is {} and the index is {}, and the fake hash is {}. ", + "The number of bits for the hash is {}, precision is {} and the number of bits is {}." + ), + register, + index, + fake_hash, + hash_bits, + CH::Precision::EXPONENT, + CH::Bits::NUMBER_OF_BITS, + ); } // After inserting the hash, we check if the hash is found. assert!( CH::find( - encoded_hashes.as_slice(), + encoded_hashes, reference_hashes.len(), index, register, @@ -304,7 +328,7 @@ mod test_composite_hash { ); let decoded: Vec<(u8, usize)> = CH::decoded( - encoded_hashes.as_slice(), + encoded_hashes, reference_hashes.len(), hash_bits, ) @@ -325,7 +349,9 @@ mod test_composite_hash { assert_eq!(decoded_index, reference_index); } - for target_hash_bytes in CH::SMALLEST_VIABLE_HASH_BITS / 8..hash_bytes { + // We include the case where the target hash bytes == hash bytes so to test + // when the degrade is called with shift == 0. + for target_hash_bytes in CH::SMALLEST_VIABLE_HASH_BITS / 8..=hash_bytes { let target_hash_bits = target_hash_bytes * 8; let shift = hash_bits - target_hash_bits; let downgraded_hash = CH::downgrade(encoded_hash, hash_bits, shift); @@ -340,7 +366,7 @@ mod test_composite_hash { assert_eq!(downgraded_hash, encoded_target_hash, "Downgraded from hash bits {hash_bits} ({encoded_hash:b}) to {target_hash_bits} hash directly encoded ({encoded_target_hash:b}) and downgraded hash do not match ({downgraded_hash:b}). The original hash is {fake_hash:064b}."); - let mut downgraded_encoded_hashes = encoded_hashes.clone(); + let mut downgraded_encoded_hashes = encoded_hashes.to_vec(); CH::downgrade_inplace( &mut downgraded_encoded_hashes, reference_hashes.len(), @@ -381,4 +407,22 @@ mod test_composite_hash { fn test_switch_hash() { test_composite_hash::>(); } + + #[test_precisions_and_bits] + fn test_gap_current_hash() + where + current::CurrentHash: + PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, + { + test_composite_hash::>>(); + } + + #[test_precisions_and_bits] + fn test_gap_switch_hash() + where + switch::SwitchHash: + PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, + { + test_composite_hash::>>(); + } } diff --git a/src/composite_hash/current.rs b/src/composite_hash/current.rs index 09d329e..b52a695 100644 --- a/src/composite_hash/current.rs +++ b/src/composite_hash/current.rs @@ -102,6 +102,12 @@ impl CompositeHash for CurrentHash { #[inline] /// Decode the hash into the register value and index. fn decode(hash: u64, hash_bits: u8) -> (u8, usize) { + debug_assert!( + hash.leading_zeros() >= u32::from(64 - hash_bits), + "The hash ({hash:064b}) should be composed of {hash_bits} and therefore must have at least {} leading zeros, but has only {}", + 64 - hash_bits, + hash.leading_zeros(), + ); // We extract the index from the rightmost bits of the hash. let index = usize::try_from(hash >> (hash_bits - P::EXPONENT)).unwrap(); // Next, we extract the register from the rightmost bits of the hash, minus the bits used for the index. @@ -171,6 +177,10 @@ impl CompositeHash for CurrentHash { hash_bits: u8, shift: u8, ) { + if shift == 0 { + return; + } + let hash_bytes = usize::from(hash_bits / 8); let shift_bytes = usize::from(shift / 8); diff --git a/src/composite_hash/gaps.rs b/src/composite_hash/gaps.rs index bdd6ddc..59735ca 100644 --- a/src/composite_hash/gaps.rs +++ b/src/composite_hash/gaps.rs @@ -1 +1,555 @@ -//! Gap-based composite hash implementation. \ No newline at end of file +//! Gap-based composite hash implementation. +use core::marker::PhantomData; +mod bitreader; +mod bitwriter; +mod optimal_codes; +mod prefix_free_codes; +use bitreader::BitReader; +use bitwriter::BitWriter; +use prefix_free_codes::{CodeRead, CodeWrite, NoPrefixCode}; + +use super::*; + +/// Gap-based composite hash. +pub struct GapHash { + _phantom: PhantomData, +} + +/// Trait defining the combination between a given combo of Precision +/// and Bits and which PrefixFreeCode to use for which combination. +pub trait PrefixFreeCode { + /// Prefix-free code for when we are writing an hash of 32 bits. + type Code: CodeRead + CodeWrite + Default + 'static; +} + +impl CompositeHash for GapHash +where + CH: PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, +{ + type Precision = ::Precision; + type Bits = ::Bits; + + type Decoded<'a> = DecodedIter<'a, CH>; + type Downgraded<'a> = DowngradedIter<'a, CH>; + + #[inline] + #[must_use] + fn downgraded<'a>( + hashes: &'a [u8], + number_of_hashes: usize, + hash_bits: u8, + shift: u8, + ) -> Self::Downgraded<'a> { + DowngradedIter::new(hashes, number_of_hashes, hash_bits, shift) + } + + #[inline] + #[must_use] + fn decoded<'a>(hashes: &'a [u8], number_of_hashes: usize, hash_bits: u8) -> Self::Decoded<'a> { + assert!( + hash_bits >= Self::SMALLEST_VIABLE_HASH_BITS, + "The hash bits ({hash_bits}) must be greater or equal to the smallest viable hash bits ({})", + Self::SMALLEST_VIABLE_HASH_BITS, + ); + DecodedIter::new(hashes, number_of_hashes, hash_bits) + } + + #[inline] + #[must_use] + /// Encode the hash from the provided register value, index and the original unsplitted hash. + fn encode(index: usize, register: u8, original_hash: u64, hash_bits: u8) -> u64 { + debug_assert!(register > 0); + debug_assert!( + index < 1 << Self::Precision::EXPONENT, + "The index ({index}) must be less than 2^({})", + Self::Precision::EXPONENT, + ); + CH::encode(index, register, original_hash, hash_bits) + } + + #[must_use] + #[inline] + /// Decode the hash into the register value and index. + fn decode(hash: u64, hash_bits: u8) -> (u8, usize) { + CH::decode(hash, hash_bits) + } + + #[inline] + #[must_use] + /// Downgrade the hash into a smaller hash. + fn downgrade(hash: u64, hash_bits: u8, shift: u8) -> u64 { + CH::downgrade(hash, hash_bits, shift) + } + + #[inline] + #[must_use] + #[allow(unsafe_code)] + fn find<'a>( + hashes: &'a [u8], + number_of_hashes: usize, + index: usize, + register: u8, + original_hash: u64, + hash_bits: u8, + ) -> Result { + debug_assert!(register > 0); + debug_assert!( + index < 1 << Self::Precision::EXPONENT, + "The index ({index}) must be less than 2^({})", + Self::Precision::EXPONENT, + ); + let encoded_hash = Self::encode(index, register, original_hash, hash_bits); + Self::downgraded(hashes, number_of_hashes, hash_bits, 0) + .position(|hash| hash == encoded_hash) + .map_or_else(|| Err((index, encoded_hash)), |index| Ok(index)) + } + + #[inline] + #[must_use] + #[allow(unsafe_code)] + fn insert_sorted_desc<'a>( + hashes: &'a mut [u8], + number_of_hashes: usize, + index: usize, + register: u8, + original_hash: u64, + hash_bits: u8, + ) -> bool { + match hash_bits { + 8 => { + if core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + { + return CH::insert_sorted_desc( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ); + } else { + insert_sorted_desc_with_writer::<>::Code, CH>( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ) + } + } + 16 => { + if core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + { + return CH::insert_sorted_desc( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ); + } else { + insert_sorted_desc_with_writer::<>::Code, CH>( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ) + } + } + 24 => { + if core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + { + return CH::insert_sorted_desc( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ); + } else { + insert_sorted_desc_with_writer::<>::Code, CH>( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ) + } + } + 32 => { + if core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + { + return CH::insert_sorted_desc( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ); + } else { + insert_sorted_desc_with_writer::<>::Code, CH>( + hashes, + number_of_hashes, + index, + register, + original_hash, + hash_bits, + ) + } + } + _ => unreachable!(), + } + } + + #[inline] + /// Downgrade the hash into a smaller hash in place. + fn downgrade_inplace<'a>( + hashes: &'a mut [u8], + number_of_hashes: usize, + hash_bits: u8, + shift: u8, + ) { + if shift == 0 { + return; + } + + match hash_bits - shift { + 8 => { + if core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + { + assert!( + core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + ); + assert!( + core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + ); + assert!( + core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + ); + CH::downgrade_inplace(hashes, number_of_hashes, hash_bits, shift); + } else { + downgrade_inplace_with_writer::<>::Code, CH>( + hashes, + number_of_hashes, + hash_bits, + shift, + ); + } + } + 16 => { + if core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + { + assert!( + core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + ); + assert!( + core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + ); + CH::downgrade_inplace(hashes, number_of_hashes, hash_bits, shift); + } else { + downgrade_inplace_with_writer::<>::Code, CH>( + hashes, + number_of_hashes, + hash_bits, + shift, + ); + } + } + 24 => { + if core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + { + assert!( + core::any::TypeId::of::<>::Code>() + == core::any::TypeId::of::>() + ); + CH::downgrade_inplace(hashes, number_of_hashes, hash_bits, shift); + } else { + downgrade_inplace_with_writer::<>::Code, CH>( + hashes, + number_of_hashes, + hash_bits, + shift, + ); + } + } + _ => unreachable!(), + } + } + + const SMALLEST_VIABLE_HASH_BITS: u8 = CH::SMALLEST_VIABLE_HASH_BITS; +} + +#[allow(unsafe_code)] +fn downgrade_inplace_with_writer<'a, CT: CodeWrite + 'static, CH: CompositeHash>( + hashes: &'a mut [u8], + number_of_hashes: usize, + hash_bits: u8, + shift: u8, +) where + CH: PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, +{ + debug_assert!(core::any::TypeId::of::() != core::any::TypeId::of::>()); + debug_assert!(core::any::TypeId::of::() != core::any::TypeId::of::>()); + debug_assert!(core::any::TypeId::of::() != core::any::TypeId::of::>()); + debug_assert!(core::any::TypeId::of::() != core::any::TypeId::of::>()); + // safe because the slice is originally allocated as u64s + debug_assert!(hashes.len() % core::mem::size_of::() == 0); + let hashes_64 = unsafe { + core::slice::from_raw_parts_mut( + hashes.as_mut_ptr() as *mut u64, + hashes.len() / core::mem::size_of::(), + ) + }; + // WE HAVE A MUTABLE AND IMMUTABLE REFERENCES, THIS VIOLATES THE ALIASING RULES + // but we always read then write, so it should be fine :^) + let readable = unsafe { core::mem::transmute::<&'a mut [u8], &'a [u8]>(hashes) }; + // created a writer at the same position ! UNSAFE ! + let mut writer = BitWriter::new(hashes_64); + + // iter until we find where we should insert + let mut iter = GapHash::::downgraded(readable, number_of_hashes, hash_bits, shift); + let iter_tell = unsafe{&*(&iter as *const _ as usize as *const as CompositeHash>::Downgraded<'_>)}; + // keep reading and then writing the value + for value in &mut iter { + debug_assert!(iter_tell.bitstream.tell() > writer.tell()); + CT::write(&mut writer, value); + } +} + +#[allow(unsafe_code)] +fn insert_sorted_desc_with_writer<'a, CW: CodeWrite + 'static, CH: CompositeHash>( + hashes: &'a mut [u8], + number_of_hashes: usize, + index: usize, + register: u8, + original_hash: u64, + hash_bits: u8, +) -> bool +where + CH: PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, +{ + debug_assert!(register > 0); + debug_assert!( + index < 1 << ::Precision::EXPONENT, + "The index ({index}) must be less than 2^({})", + ::Precision::EXPONENT, + ); + // safe because the slice is originally allocated as u64s + debug_assert!( + hashes.len() % core::mem::size_of::() == 0, + "Expected the length of the hashes to be a multiple of the size of u64, but got {}", + hashes.len() + ); + let hashes_64 = unsafe { + core::slice::from_raw_parts_mut( + hashes.as_mut_ptr() as *mut u64, + hashes.len() / core::mem::size_of::(), + ) + }; + // WE HAVE A MUTABLE AND IMMUTABLE REFERENCES, THIS VIOLATES THE ALIASING RULES + // but we always read then write, so it should be fine :^) + let readable = unsafe { core::mem::transmute::<&'a mut [u8], &'a [u8]>(hashes) }; + + // iter until we find where we should insert + let mut iter = GapHash::::downgraded(readable, number_of_hashes, hash_bits, 0); + let encoded = CH::encode(index, register, original_hash, hash_bits); + for value in &mut iter { + if value <= encoded { + if value == encoded { + return false; + } + break; + } + } + // created a writer at the same position ! UNSAFE ! + let mut writer = BitWriter::new(hashes_64); + writer.seek(iter.bitstream.tell()); + let mut value_to_write = encoded; + // keep reading and then writing the value + let iter_tell = unsafe{&*(&iter as *const _ as usize as *const as CompositeHash>::Downgraded<'_>)}; + for value in &mut iter { + debug_assert!(iter_tell.bitstream.tell() > writer.tell()); + CW::write(&mut writer, value); + value_to_write = value; + } + // write the final value, this is needed because we keep out of sync + // with the reader + CW::write(&mut writer, value_to_write); + + true +} + +/// Iterator over downgraded hashes. +pub struct DowngradedIter<'a, CH> { + bitstream: BitReader<'a>, + previous: u64, + number_of_hashes: usize, + hash_bits: u8, + shift: u8, + _phantom: PhantomData, +} + +impl<'a, CH: CompositeHash> DowngradedIter<'a, CH> { + #[allow(unsafe_code)] + fn new(hashes: &'a [u8], number_of_hashes: usize, hash_bits: u8, shift: u8) -> Self { + let hashes: &mut [u32] = unsafe { + core::slice::from_raw_parts_mut( + hashes.as_ptr() as *mut u32, + hashes.len() / core::mem::size_of::(), + ) + }; + + Self { + bitstream: BitReader::new(hashes), + previous: 0, + number_of_hashes, + hash_bits, + shift, + _phantom: PhantomData, + } + } +} + +impl<'a, CH: CompositeHash> Iterator for DowngradedIter<'a, CH> +where + CH: PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, +{ + type Item = u64; + + #[inline(always)] + fn next(&mut self) -> Option { + if self.number_of_hashes == 0 { + return None; + } + let gap = match self.hash_bits { + 8 => >::Code::read(&mut self.bitstream), + 16 => >::Code::read(&mut self.bitstream), + 24 => >::Code::read(&mut self.bitstream), + 32 => >::Code::read(&mut self.bitstream), + _ => unreachable!(), + }; + self.previous += gap; + self.number_of_hashes -= 1; + + debug_assert!( + self.previous.leading_zeros() >= 64 - u32::from(self.hash_bits), + "The hash ({}), being theoretically {} bits long, has more than {} leading zeros", + self.previous, + self.hash_bits, + 64 - u32::from(self.hash_bits), + ); + + Some(CH::downgrade(self.previous, self.hash_bits, self.shift)) + } + + #[inline(always)] + fn size_hint(&self) -> (usize, Option) { + (self.number_of_hashes, Some(self.number_of_hashes)) + } +} + +impl<'a, CH: CompositeHash> ExactSizeIterator for DowngradedIter<'a, CH> +where + CH: PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, +{ + #[inline(always)] + fn len(&self) -> usize { + self.number_of_hashes + } +} + +/// Iterator over decoded hashes. +pub struct DecodedIter<'a, CH> { + bitstream: BitReader<'a>, + previous: u64, + number_of_hashes: usize, + hash_bits: u8, + _phantom: PhantomData, +} + +impl<'a, CH: CompositeHash> DecodedIter<'a, CH> { + #[allow(unsafe_code)] + fn new(hashes: &'a [u8], number_of_hashes: usize, hash_bits: u8) -> Self { + let hashes: &mut [u32] = unsafe { + core::slice::from_raw_parts_mut( + hashes.as_ptr() as *mut u32, + hashes.len() / core::mem::size_of::(), + ) + }; + + Self { + bitstream: BitReader::new(hashes), + previous: 0, + number_of_hashes, + hash_bits, + _phantom: PhantomData, + } + } +} + +impl<'a, CH: CompositeHash> Iterator for DecodedIter<'a, CH> +where + CH: PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, +{ + type Item = (u8, usize); + + #[inline(always)] + fn next(&mut self) -> Option { + if self.number_of_hashes == 0 { + return None; + } + let gap = match self.hash_bits { + 8 => >::Code::read(&mut self.bitstream), + 16 => >::Code::read(&mut self.bitstream), + 24 => >::Code::read(&mut self.bitstream), + 32 => >::Code::read(&mut self.bitstream), + _ => unreachable!(), + }; + self.previous += gap; + self.number_of_hashes -= 1; + + debug_assert!( + self.previous.leading_zeros() >= 64 - u32::from(self.hash_bits), + "The hash ({}), being theoretically {} bits long, has more than {} leading zeros", + self.previous, + self.hash_bits, + 64 - u32::from(self.hash_bits), + ); + + Some(CH::decode(self.previous, self.hash_bits)) + } + + #[inline(always)] + fn size_hint(&self) -> (usize, Option) { + (self.number_of_hashes, Some(self.number_of_hashes)) + } +} + +impl<'a, CH: CompositeHash> ExactSizeIterator for DecodedIter<'a, CH> +where + CH: PrefixFreeCode<8> + PrefixFreeCode<16> + PrefixFreeCode<24> + PrefixFreeCode<32>, +{ + #[inline(always)] + fn len(&self) -> usize { + self.number_of_hashes + } +} diff --git a/src/composite_hash/gaps/bitreader.rs b/src/composite_hash/gaps/bitreader.rs new file mode 100644 index 0000000..88e5aec --- /dev/null +++ b/src/composite_hash/gaps/bitreader.rs @@ -0,0 +1,185 @@ + + +#[derive(Debug, Clone, Copy)] +pub struct BitReader<'a> { + data: &'a [u32], + word_idx: usize, + buffer: u64, + bits_in_buffer: usize, +} + +impl<'a> BitReader<'a> { + pub fn new(data: &'a[u32]) -> Self { + Self { + data, + word_idx: 0, + buffer: 0, + bits_in_buffer: 0, + } + } + + pub fn seek(&mut self, bit_idx: usize) { + self.word_idx = bit_idx / 32; + let in_word_idx = bit_idx % 32; + self.buffer = (self.data[self.word_idx] << in_word_idx) as u64; + self.bits_in_buffer = 32 - in_word_idx; + } + + pub fn tell(&self) -> usize { + self.word_idx * 32 + self.bits_in_buffer + } + + #[inline] + pub fn read_bits(&mut self, mut n_bits: usize) -> u64 { + debug_assert!(n_bits <= 64); + debug_assert!(self.bits_in_buffer < 64); + + if n_bits <= self.bits_in_buffer { + let result = self.buffer >> (64 - n_bits - 1) >> 1; + self.bits_in_buffer -= n_bits; + self.buffer <<= n_bits; + return result; + } + + let mut result: u64 = + self.buffer >> (64 - 1 - self.bits_in_buffer) >> 1_u8; + n_bits -= self.bits_in_buffer; + + while n_bits > 32 { + let new_word: u64 = self.data[self.word_idx].to_be() as u64; + self.word_idx += 1; + result = (result << 32) | new_word; + n_bits -= 32; + } + + debug_assert!(n_bits > 0); + debug_assert!(n_bits <= 32); + + let new_word = self.data[self.word_idx].to_be(); + self.word_idx += 1; + self.bits_in_buffer = 32 - n_bits; + let upcasted: u64 = new_word as u64; + let final_bits: u64 = upcasted >> self.bits_in_buffer; + result = (result << (n_bits - 1) << 1) | final_bits; + self.buffer = ((new_word as u64) + << (64 - self.bits_in_buffer - 1)) + << 1; + + result + } + + #[inline] + pub fn read_unary(&mut self) -> u64 { + debug_assert!(self.bits_in_buffer < 64); + + let zeros: usize = self.buffer.leading_zeros() as _; + + if zeros < self.bits_in_buffer { + self.buffer = self.buffer << zeros << 1; + self.bits_in_buffer -= zeros + 1; + return zeros as u64; + } + + let mut result: u64 = self.bits_in_buffer as _; + + loop { + let new_word = self.data[self.word_idx].to_be(); + self.word_idx += 1; + + if new_word != 0 { + let zeros: usize = new_word.leading_zeros() as _; + self.buffer = + (new_word as u64) << (32 + zeros) << 1; + self.bits_in_buffer = 32 - zeros - 1; + return result + zeros as u64; + } + result += 32 as u64; + } + } + + #[inline] + pub fn skip_bits(&mut self, mut n_bits: usize) { + debug_assert!(self.bits_in_buffer < 64); + if n_bits <= self.bits_in_buffer { + self.bits_in_buffer -= n_bits; + self.buffer <<= n_bits; + return; + } + + n_bits -= self.bits_in_buffer; + + while n_bits > 32 { + self.word_idx += 1; + n_bits -= 32; + } + + let new_word = self.data[self.word_idx]; + self.word_idx += 1; + self.bits_in_buffer = 32 - n_bits; + + self.buffer = (new_word as u64) + << (64 - 1 - self.bits_in_buffer) + << 1; + } + + pub fn read_minimal_binary(&mut self, max: u64) -> u64 { + let l = max.ilog2(); + let mut prefix = self.read_bits(l as _); + let limit = (1 << (l + 1)) - max; + + if prefix < limit { + prefix + } else { + prefix <<= 1; + prefix |= self.read_bits(1); + prefix - limit + } + } + + pub fn read_gamma(&mut self) -> u64 { + let len = self.read_unary(); + self.read_bits(len as usize) + (1 << len) - 1 + } + + pub fn read_delta(&mut self) -> u64 { + let len = self.read_gamma(); + self.read_bits(len as usize) + (1 << len) - 1 + } + + pub fn read_golomb(&mut self, b: usize) -> u64 { + self.read_unary() * b as u64 + self.read_minimal_binary(b as u64) + } + + pub fn read_rice(&mut self, b: usize) -> u64 { + (self.read_unary() << b) + self.read_bits(b) + } + + pub fn read_exp_golomb(&mut self, b: usize) -> u64 { + (self.read_gamma() << b) + self.read_bits(b) + } + + pub fn read_zeta(&mut self, k: usize) -> u64 { + let h = self.read_unary(); + let u = 1 << ((h + 1) * k as u64); + let l = 1 << (h * k as u64); + let res = self.read_minimal_binary(u - l); + l + res - 1 + } + + pub fn read_pi(&mut self, k: usize) -> u64 { + let l = self.read_unary() + 1; + let v = self.read_bits(k); + let h = l * (1 << k) - v; + let r = h - 1; + let rem = self.read_bits(r as usize); + (1 << r) + rem - 1 + } + + pub fn read_pi_web(&mut self, k: usize) -> u64 { + if self.read_bits(1) == 1 { + 0 + } else { + self.read_pi(k) + 1 + } + } +} \ No newline at end of file diff --git a/src/composite_hash/gaps/bitwriter.rs b/src/composite_hash/gaps/bitwriter.rs new file mode 100644 index 0000000..8790bc7 --- /dev/null +++ b/src/composite_hash/gaps/bitwriter.rs @@ -0,0 +1,198 @@ +//! Implementation for a writer of codes on a bit stream. + +#[derive(Debug)] +/// A writer of codes on a bit stream. +pub struct BitWriter<'a> { + data: &'a mut [u64], + word_idx: usize, + buffer: u64, + space_left_in_buffer: usize, +} + +impl<'a> core::ops::Drop for BitWriter<'a> { + fn drop(&mut self) { + self.flush() + } +} + +impl<'a> BitWriter<'a> { + pub fn new(data: &'a mut [u64]) -> Self { + Self { + data, + word_idx: 0, + buffer: 0, + space_left_in_buffer: 64, + } + } + + pub fn flush(&mut self) { + let to_flush = 64 - self.space_left_in_buffer; + if to_flush != 0 { + let buffer = self.buffer << self.space_left_in_buffer; + let old_word = u64::from_be(self.data[self.word_idx]); + let clean_old_word = (old_word << to_flush) >> to_flush; + let new_word = (clean_old_word | buffer).to_be(); + self.data[self.word_idx] = new_word; + } + } + + pub fn seek(&mut self, bits_idx: usize) { + self.flush(); + self.word_idx = bits_idx / 64; + let idx_in_word = bits_idx % 64; + self.space_left_in_buffer = 64 - idx_in_word; + self.buffer = self.data[self.word_idx]; + } + + pub fn tell(&self) -> usize { + self.word_idx * 64 + (64 - self.space_left_in_buffer) + } + + #[inline] + pub fn write_bits(&mut self, value: u64, n_bits: usize) -> usize { + debug_assert!(n_bits <= 64); + debug_assert!(self.space_left_in_buffer > 0); + + if n_bits < self.space_left_in_buffer { + self.buffer <<= n_bits; + self.buffer |= value & !(u64::MAX << n_bits as u32); + self.space_left_in_buffer -= n_bits; + return n_bits; + } + + self.buffer = self.buffer << (self.space_left_in_buffer - 1) << 1; + self.buffer |= value << (64 - n_bits) >> (64 - self.space_left_in_buffer); + self.data[self.word_idx] = self.buffer.to_be(); + self.word_idx += 1; + + let mut to_write = n_bits - self.space_left_in_buffer; + + for _ in 0..to_write / 64 { + to_write -= 64; + self.data[self.word_idx] = (value >> to_write).to_be(); + self.word_idx += 1; + } + + self.space_left_in_buffer = 64 - to_write; + self.buffer = value; + n_bits + } + + #[inline] + pub fn write_unary(&mut self, mut value: u64) -> usize { + debug_assert_ne!(value, u64::MAX); + debug_assert!(self.space_left_in_buffer > 0); + + let code_length = value + 1; + + if code_length <= self.space_left_in_buffer as u64 { + self.space_left_in_buffer -= code_length as usize; + self.buffer = self.buffer << value << 1; + self.buffer |= 1; + if self.space_left_in_buffer == 0 { + self.data[self.word_idx] = self.buffer.to_be(); + self.word_idx += 1; + self.space_left_in_buffer = 64; + } + return code_length as usize; + } + + self.buffer = self.buffer << (self.space_left_in_buffer - 1) << 1; + self.data[self.word_idx] = self.buffer.to_be(); + self.word_idx += 1; + + value -= self.space_left_in_buffer as u64; + + for _ in 0..value / 64 { + self.data[self.word_idx] = 0; + self.word_idx += 1; + } + + value %= 64; + + if value == 64 - 1 { + self.data[self.word_idx] = 1_u64.to_be(); + self.word_idx += 1; + self.space_left_in_buffer = 64; + } else { + self.buffer = 1; + self.space_left_in_buffer = 64 - (value as usize + 1); + } + + code_length as usize + } + + pub fn write_minimal_binary(&mut self, value: u64, max: u64) -> usize { + let l = max.ilog2(); + let limit = (1 << (l + 1)) - max; + + if value < limit { + self.write_bits(value, l as _) + } else { + let to_write = value + limit; + self.write_bits(to_write >> 1, l as _); + self.write_bits(to_write & 1, 1); + (l + 1) as usize + } + } + + pub fn write_gamma(&mut self, mut value: u64) -> usize { + value += 1; + let n_bits = value.ilog2(); + self.write_unary(n_bits as u64) + self.write_bits(value, n_bits as usize) + } + + pub fn write_delta(&mut self, mut value: u64) -> usize { + value += 1; + let n_bits = value.ilog2(); + self.write_gamma(n_bits as u64) + self.write_bits(value, n_bits as usize) + } + + pub fn write_rice(&mut self, value: u64, b: u64) -> usize { + self.write_unary(value >> b) + self.write_bits(value, b as usize) + } + + pub fn write_golomb(&mut self, value: u64, b: u64) -> usize { + self.write_unary(value / b) + self.write_minimal_binary(value % b, b) + } + + pub fn write_exp_golomb(&mut self, value: u64, b: u64) -> usize { + self.write_gamma(value >> b) + self.write_bits(value, b as usize) + } + + pub fn write_zeta(&mut self, mut value: u64, k: u64) -> usize { + value += 1; + let h = value.ilog2() as u64 / k; + let u = 1 << ((h + 1) * k); + let l = 1 << (h * k); + + debug_assert!(l <= value, "{} <= {}", l, value); + debug_assert!(value < u, "{} < {}", value, u); + + self.write_unary(h) + self.write_minimal_binary(value - l, u - l) + } + + pub fn write_pi(&mut self, mut value: u64, k: u64) -> usize { + value += 1; + let r = value.ilog2() as usize; + let h = 1 + r; + let l = h.div_ceil(1 << k); + let v = (l * (1 << k) - h) as u64; + let rem = value & !(u64::MAX << r); + + let mut written_bits = 0; + written_bits += self.write_unary((l - 1) as u64); + written_bits += self.write_bits(v, k as usize); + written_bits += self.write_bits(rem, r); + + written_bits + } + + pub fn write_pi_web(&mut self, value: u64, k: u64) -> usize { + if value == 0 { + self.write_bits(1, 1) + } else { + self.write_bits(0, 1) + self.write_pi(value - 1, k) + } + } +} diff --git a/src/composite_hash/gaps/optimal_codes.rs b/src/composite_hash/gaps/optimal_codes.rs new file mode 100644 index 0000000..a723ae0 --- /dev/null +++ b/src/composite_hash/gaps/optimal_codes.rs @@ -0,0 +1,3070 @@ +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<25usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<25usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<26usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<26usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<20usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<27usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<26usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<27usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<25usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_5")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<13usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<20usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<26usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_5")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<27usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<22usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<23usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<20usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<21usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<22usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<23usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<27usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<7usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<24usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<26usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<25usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<24usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<14usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<23usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<27usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<15usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<20usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<13usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<21usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<14usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<20usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<15usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<14usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<25usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<26usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<14usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<20usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<14usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_5")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<15usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<7usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<15usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<21usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<7usize>; +} +#[cfg(feature = "precision_4")] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::Golomb<45usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<13usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<21usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<13usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<24usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<22usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<15usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<24usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<24usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<27usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<15usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<23usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_4")] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::Golomb<45usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<25usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<22usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<21usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<8usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<23usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<13usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<22usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<21usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_17")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<10usize>; +} +#[cfg(feature = "precision_5")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<14usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_9")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<17usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<24usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<22usize>; +} +#[cfg(feature = "precision_7")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_6")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_12")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<13usize>; +} +#[cfg(feature = "precision_14")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<11usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_13")] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<12usize>; +} +#[cfg(feature = "precision_16")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::ExpGolomb<18usize>; +} +#[cfg(feature = "precision_18")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<16usize>; +} +#[cfg(feature = "precision_11")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::ExpGolomb<23usize>; +} +#[cfg(feature = "precision_15")] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<19usize>; +} +#[cfg(feature = "precision_10")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<7usize>; +} +#[cfg(feature = "precision_8")] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::ExpGolomb<9usize>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_4")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision4, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_5")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision5, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_6")] +#[cfg(test)] +impl super::PrefixFreeCode<32u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision6, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<32u8>; +} +#[cfg(feature = "precision_7")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_7")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_7")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_7")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_7")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_7")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision7, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_8")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_8")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_8")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_8")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_8")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_8")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision8, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_9")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_9")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_9")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_9")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_9")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_9")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_9")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision9, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_10")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision10, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_11")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision11, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_12")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision12, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_13")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision13, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_14")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision14, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_15")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision15, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_16")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision16, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_17")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision17, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits4, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits5, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<8u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<8u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<16u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<16u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::CurrentHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} +#[cfg(feature = "precision_18")] +#[cfg(test)] +impl super::PrefixFreeCode<24u8> +for crate::composite_hash::SwitchHash< + crate::precisions::Precision18, + crate::bits::Bits6, +> { + type Code = super::prefix_free_codes::NoPrefixCode<24u8>; +} diff --git a/src/composite_hash/gaps/prefix_free_codes.rs b/src/composite_hash/gaps/prefix_free_codes.rs new file mode 100644 index 0000000..a092a8b --- /dev/null +++ b/src/composite_hash/gaps/prefix_free_codes.rs @@ -0,0 +1,79 @@ +//! Struct markers for Prefix-Free Codes. +use super::bitreader::BitReader; +use super::bitwriter::BitWriter; + +/// Trait for reading a code from a bit stream. +pub trait CodeRead { + /// Read a code from a bit stream. + fn read(reader: &mut BitReader) -> u64; +} + +/// Trait for writing a code to a bit stream. +pub trait CodeWrite { + /// Write a code to a bit stream. + fn write(writer: &mut BitWriter, value: u64) -> usize; +} + +#[derive(Default)] +/// Golomb code with a given parameter B. +pub struct Golomb; + +impl CodeRead for Golomb { + fn read(reader: &mut BitReader) -> u64 { + reader.read_golomb(B) + } +} + +impl CodeWrite for Golomb { + fn write(writer: &mut BitWriter, value: u64) -> usize { + writer.write_golomb(value, B as u64) + } +} + +#[derive(Default)] +/// Rice code with a given parameter B. +pub struct Rice; + +impl CodeRead for Rice { + fn read(reader: &mut BitReader) -> u64 { + reader.read_rice(B) + } +} + +impl CodeWrite for Rice { + fn write(writer: &mut BitWriter, value: u64) -> usize { + writer.write_rice(value, B as u64) + } +} + +#[derive(Default)] +/// Exponential Golomb code with a given parameter B. +pub struct ExpGolomb; + +impl CodeRead for ExpGolomb { + fn read(reader: &mut BitReader) -> u64 { + reader.read_exp_golomb(B) + } +} + +impl CodeWrite for ExpGolomb { + fn write(writer: &mut BitWriter, value: u64) -> usize { + writer.write_exp_golomb(value, B as u64) + } +} + +#[derive(Default)] +/// No prefix code. +pub struct NoPrefixCode; + +impl CodeRead for NoPrefixCode { + fn read(reader: &mut BitReader) -> u64 { + reader.read_bits(HS as usize) + } +} + +impl CodeWrite for NoPrefixCode { + fn write(writer: &mut BitWriter, value: u64) -> usize { + writer.write_bits(value, HS as usize) + } +} diff --git a/src/composite_hash/shared.rs b/src/composite_hash/shared.rs index 29e4449..4255c93 100644 --- a/src/composite_hash/shared.rs +++ b/src/composite_hash/shared.rs @@ -259,7 +259,12 @@ where CH: CompositeHash, { assert!(hash_bits >= 8); - assert!(hash_bits >= CH::SMALLEST_VIABLE_HASH_BITS); + assert!( + hash_bits >= CH::SMALLEST_VIABLE_HASH_BITS, + "The hash bits ({}) must be greater or equal to the smallest viable hash bits ({})", + hash_bits, + CH::SMALLEST_VIABLE_HASH_BITS, + ); let hash_bytes = usize::from(hash_bits / 8); match CH::find( diff --git a/src/composite_hash/switch.rs b/src/composite_hash/switch.rs index 5902e7d..2497f30 100644 --- a/src/composite_hash/switch.rs +++ b/src/composite_hash/switch.rs @@ -19,7 +19,7 @@ fn flag(hash: u64, hash_bits: u8) -> bool { ((hash >> (hash_bits - P::EXPONENT - 1)) & 1) == 1 } -const fn smallest_viable_switch_hash() -> u8 { +pub(super) const fn smallest_viable_switch_hash() -> u8 { if P::EXPONENT == 4 && B::NUMBER_OF_BITS == 4 { return 8; } @@ -50,6 +50,10 @@ impl CompositeHash for SwitchHash { hash_bits: u8, shift: u8, ) { + if shift == 0 { + return; + } + let hash_bytes = usize::from(hash_bits) / 8; let downgraded_hash_bytes = usize::from(hash_bits - shift) / 8; @@ -183,7 +187,11 @@ impl CompositeHash for SwitchHash { /// Encode the hash from the provided register value, index and the original unsplitted hash. fn encode(index: usize, register: u8, original_hash: u64, hash_bits: u8) -> u64 { debug_assert!(register > 0); - debug_assert!(index < 1 << Self::Precision::EXPONENT); + debug_assert!( + index < 1 << Self::Precision::EXPONENT, + "The index ({index}) must be less than 2^({})", + Self::Precision::EXPONENT, + ); // We start by encoding the index in the rightmost bits of the hash. let mut composite_hash = (index as u64) << (hash_bits - Self::Precision::EXPONENT); @@ -269,9 +277,22 @@ impl CompositeHash for SwitchHash { #[inline] /// Decode the hash into the register value and index. fn decode(hash: u64, hash_bits: u8) -> (u8, usize) { + debug_assert!( + hash.leading_zeros() >= u32::from(64 - hash_bits), + "The hash ({hash:064b}) should be composed of {hash_bits} and therefore must have at least {} leading zeros, but has only {}", + 64 - hash_bits, + hash.leading_zeros(), + ); + // We extract the index from the leftmost bits of the hash. let index = usize::try_from(hash >> (hash_bits - Self::Precision::EXPONENT)).unwrap(); + debug_assert!( + index < 1 << Self::Precision::EXPONENT, + "While decoding the hash ({hash:064b}), the index ({index}) must be less than 2^({})", + Self::Precision::EXPONENT + ); + // If the hash barely fits as is, we do not need to do anything special. if Self::Precision::EXPONENT + Self::Bits::NUMBER_OF_BITS == hash_bits { let register = u8::try_from(hash & Self::Bits::MASK).unwrap(); diff --git a/src/registers/packed_array.rs b/src/registers/packed_array.rs index 07cc3d3..2fd163f 100644 --- a/src/registers/packed_array.rs +++ b/src/registers/packed_array.rs @@ -447,7 +447,10 @@ macro_rules! impl_as_ref_mut { #[allow(unsafe_code)] fn as_mut(&mut self) -> &mut [$typ] { let words_u64: &mut [u64] = self.words.as_mut(); - unsafe { core::slice::from_raw_parts_mut(words_u64.as_mut_ptr().cast::<$typ>(), words_u64.len() * 8 / core::mem::size_of::<$typ>()) } + let slice = unsafe { core::slice::from_raw_parts_mut(words_u64.as_mut_ptr().cast::<$typ>(), words_u64.len() * 8 / core::mem::size_of::<$typ>()) }; + debug_assert_eq!(slice.len(), N * 64 / core::mem::size_of::<$typ>()); + debug_assert_eq!(slice.len() % core::mem::size_of::(), 0); + slice } } )*