1/* ========================================================================= 2 zhash_primes.h - 5 largest primes less than 2^n for n = 4...63 3 4 Copyright (c) the Contributors as noted in the AUTHORS file. 5 This file is part of CZMQ, the high-level C binding for 0MQ: 6 http://czmq.zeromq.org. 7 8 This Source Code Form is subject to the terms of the Mozilla Public 9 License, v. 2.0. If a copy of the MPL was not distributed with this 10 file, You can obtain one at http://mozilla.org/MPL/2.0/. 11 ========================================================================= 12*/ 13 14#ifndef __ZHASH_PRIMES_H_INCLUDED__ 15#define __ZHASH_PRIMES_H_INCLUDED__ 16 17#ifdef _MSC_VER 18# define PORTABLE_LLU(number) number##ULL 19#else 20# define PORTABLE_LLU(number) number##LLU 21#endif 22 23static size_t primes [] = { 24 PORTABLE_LLU(3), 25 PORTABLE_LLU(5), 26 PORTABLE_LLU(7), 27 PORTABLE_LLU(11), 28 PORTABLE_LLU(13), // 2^4 29 PORTABLE_LLU(17), 30 PORTABLE_LLU(19), 31 PORTABLE_LLU(23), 32 PORTABLE_LLU(29), 33 PORTABLE_LLU(31), // 2^5 34 PORTABLE_LLU(43), 35 PORTABLE_LLU(47), 36 PORTABLE_LLU(53), 37 PORTABLE_LLU(59), 38 PORTABLE_LLU(61), // 2^6 39 PORTABLE_LLU(103), 40 PORTABLE_LLU(107), 41 PORTABLE_LLU(109), 42 PORTABLE_LLU(113), 43 PORTABLE_LLU(127), // 2^7 44 PORTABLE_LLU(229), 45 PORTABLE_LLU(233), 46 PORTABLE_LLU(239), 47 PORTABLE_LLU(241), 48 PORTABLE_LLU(251), // 2^8 49 PORTABLE_LLU(487), 50 PORTABLE_LLU(491), 51 PORTABLE_LLU(499), 52 PORTABLE_LLU(503), 53 PORTABLE_LLU(509), // 2^9 54 PORTABLE_LLU(997), 55 PORTABLE_LLU(1009), 56 PORTABLE_LLU(1013), 57 PORTABLE_LLU(1019), 58 PORTABLE_LLU(1021), // 2^10 59 PORTABLE_LLU(2011), 60 PORTABLE_LLU(2017), 61 PORTABLE_LLU(2027), 62 PORTABLE_LLU(2029), 63 PORTABLE_LLU(2039), // 2^11 64 PORTABLE_LLU(4057), 65 PORTABLE_LLU(4073), 66 PORTABLE_LLU(4079), 67 PORTABLE_LLU(4091), 68 PORTABLE_LLU(4093), // 2^12 69 PORTABLE_LLU(8161), 70 PORTABLE_LLU(8167), 71 PORTABLE_LLU(8171), 72 PORTABLE_LLU(8179), 73 PORTABLE_LLU(8191), // 2^13 74 PORTABLE_LLU(16349), 75 PORTABLE_LLU(16361), 76 PORTABLE_LLU(16363), 77 PORTABLE_LLU(16369), 78 PORTABLE_LLU(16381), // 2^14 79 PORTABLE_LLU(32707), 80 PORTABLE_LLU(32713), 81 PORTABLE_LLU(32717), 82 PORTABLE_LLU(32719), 83 PORTABLE_LLU(32749), // 2^15 84 PORTABLE_LLU(65449), 85 PORTABLE_LLU(65479), 86 PORTABLE_LLU(65497), 87 PORTABLE_LLU(65519), 88 PORTABLE_LLU(65521), // 2^16 89 PORTABLE_LLU(131023), 90 PORTABLE_LLU(131041), 91 PORTABLE_LLU(131059), 92 PORTABLE_LLU(131063), 93 PORTABLE_LLU(131071), // 2^17 94 PORTABLE_LLU(262111), 95 PORTABLE_LLU(262121), 96 PORTABLE_LLU(262127), 97 PORTABLE_LLU(262133), 98 PORTABLE_LLU(262139), // 2^18 99 PORTABLE_LLU(524243), 100 PORTABLE_LLU(524257), 101 PORTABLE_LLU(524261), 102 PORTABLE_LLU(524269), 103 PORTABLE_LLU(524287), // 2^19 104 PORTABLE_LLU(1048517), 105 PORTABLE_LLU(1048549), 106 PORTABLE_LLU(1048559), 107 PORTABLE_LLU(1048571), 108 PORTABLE_LLU(1048573), // 2^20 109 PORTABLE_LLU(2097091), 110 PORTABLE_LLU(2097097), 111 PORTABLE_LLU(2097131), 112 PORTABLE_LLU(2097133), 113 PORTABLE_LLU(2097143), // 2^21 114 PORTABLE_LLU(4194247), 115 PORTABLE_LLU(4194271), 116 PORTABLE_LLU(4194277), 117 PORTABLE_LLU(4194287), 118 PORTABLE_LLU(4194301), // 2^22 119 PORTABLE_LLU(8388547), 120 PORTABLE_LLU(8388571), 121 PORTABLE_LLU(8388581), 122 PORTABLE_LLU(8388587), 123 PORTABLE_LLU(8388593), // 2^23 124 PORTABLE_LLU(16777141), 125 PORTABLE_LLU(16777153), 126 PORTABLE_LLU(16777183), 127 PORTABLE_LLU(16777199), 128 PORTABLE_LLU(16777213), // 2^24 129 PORTABLE_LLU(33554341), 130 PORTABLE_LLU(33554347), 131 PORTABLE_LLU(33554371), 132 PORTABLE_LLU(33554383), 133 PORTABLE_LLU(33554393), // 2^25 134 PORTABLE_LLU(67108763), 135 PORTABLE_LLU(67108777), 136 PORTABLE_LLU(67108819), 137 PORTABLE_LLU(67108837), 138 PORTABLE_LLU(67108859), // 2^26 139 PORTABLE_LLU(134217593), 140 PORTABLE_LLU(134217613), 141 PORTABLE_LLU(134217617), 142 PORTABLE_LLU(134217649), 143 PORTABLE_LLU(134217689), // 2^27 144 PORTABLE_LLU(268435331), 145 PORTABLE_LLU(268435337), 146 PORTABLE_LLU(268435361), 147 PORTABLE_LLU(268435367), 148 PORTABLE_LLU(268435399), // 2^28 149 PORTABLE_LLU(536870839), 150 PORTABLE_LLU(536870849), 151 PORTABLE_LLU(536870869), 152 PORTABLE_LLU(536870879), 153 PORTABLE_LLU(536870909), // 2^29 154 PORTABLE_LLU(1073741719), 155 PORTABLE_LLU(1073741723), 156 PORTABLE_LLU(1073741741), 157 PORTABLE_LLU(1073741783), 158 PORTABLE_LLU(1073741789), // 2^30 159 PORTABLE_LLU(2147483563), 160 PORTABLE_LLU(2147483579), 161 PORTABLE_LLU(2147483587), 162 PORTABLE_LLU(2147483629), 163 PORTABLE_LLU(2147483647), // 2^31 164 PORTABLE_LLU(4294967197), 165 PORTABLE_LLU(4294967231), 166 PORTABLE_LLU(4294967279), 167 PORTABLE_LLU(4294967291), 168 PORTABLE_LLU(4294967295), // 2^32 169#if __WORDSIZE == 64 170 PORTABLE_LLU(8589934581), 171 PORTABLE_LLU(8589934585), 172 PORTABLE_LLU(8589934587), 173 PORTABLE_LLU(8589934589), 174 PORTABLE_LLU(8589934591), // 2^33 175 PORTABLE_LLU(17179869175), 176 PORTABLE_LLU(17179869177), 177 PORTABLE_LLU(17179869179), 178 PORTABLE_LLU(17179869181), 179 PORTABLE_LLU(17179869183), // 2^34 180 PORTABLE_LLU(34359738359), 181 PORTABLE_LLU(34359738361), 182 PORTABLE_LLU(34359738363), 183 PORTABLE_LLU(34359738365), 184 PORTABLE_LLU(34359738367), // 2^35 185 PORTABLE_LLU(68719476725), 186 PORTABLE_LLU(68719476727), 187 PORTABLE_LLU(68719476729), 188 PORTABLE_LLU(68719476733), 189 PORTABLE_LLU(68719476735), // 2^36 190 PORTABLE_LLU(137438953463), 191 PORTABLE_LLU(137438953465), 192 PORTABLE_LLU(137438953467), 193 PORTABLE_LLU(137438953469), 194 PORTABLE_LLU(137438953471), // 2^37 195 PORTABLE_LLU(274877906935), 196 PORTABLE_LLU(274877906937), 197 PORTABLE_LLU(274877906939), 198 PORTABLE_LLU(274877906941), 199 PORTABLE_LLU(274877906943), // 2^38 200 PORTABLE_LLU(549755813877), 201 PORTABLE_LLU(549755813879), 202 PORTABLE_LLU(549755813883), 203 PORTABLE_LLU(549755813885), 204 PORTABLE_LLU(549755813887), // 2^39 205 PORTABLE_LLU(1099511627767), 206 PORTABLE_LLU(1099511627769), 207 PORTABLE_LLU(1099511627771), 208 PORTABLE_LLU(1099511627773), 209 PORTABLE_LLU(1099511627775), // 2^40 210 PORTABLE_LLU(2199023255543), 211 PORTABLE_LLU(2199023255545), 212 PORTABLE_LLU(2199023255547), 213 PORTABLE_LLU(2199023255549), 214 PORTABLE_LLU(2199023255551), // 2^41 215 PORTABLE_LLU(4398046511095), 216 PORTABLE_LLU(4398046511097), 217 PORTABLE_LLU(4398046511099), 218 PORTABLE_LLU(4398046511101), 219 PORTABLE_LLU(4398046511103), // 2^42 220 PORTABLE_LLU(8796093022199), 221 PORTABLE_LLU(8796093022201), 222 PORTABLE_LLU(8796093022203), 223 PORTABLE_LLU(8796093022205), 224 PORTABLE_LLU(8796093022207), // 2^43 225 PORTABLE_LLU(17592186044407), 226 PORTABLE_LLU(17592186044409), 227 PORTABLE_LLU(17592186044411), 228 PORTABLE_LLU(17592186044413), 229 PORTABLE_LLU(17592186044415), // 2^44 230 PORTABLE_LLU(35184372088823), 231 PORTABLE_LLU(35184372088825), 232 PORTABLE_LLU(35184372088827), 233 PORTABLE_LLU(35184372088829), 234 PORTABLE_LLU(35184372088831), // 2^45 235 PORTABLE_LLU(70368744177655), 236 PORTABLE_LLU(70368744177657), 237 PORTABLE_LLU(70368744177659), 238 PORTABLE_LLU(70368744177661), 239 PORTABLE_LLU(70368744177663), // 2^46 240 PORTABLE_LLU(140737488355319), 241 PORTABLE_LLU(140737488355321), 242 PORTABLE_LLU(140737488355323), 243 PORTABLE_LLU(140737488355325), 244 PORTABLE_LLU(140737488355327), // 2^47 245 PORTABLE_LLU(281474976710647), 246 PORTABLE_LLU(281474976710649), 247 PORTABLE_LLU(281474976710651), 248 PORTABLE_LLU(281474976710653), 249 PORTABLE_LLU(281474976710655), // 2^48 250 PORTABLE_LLU(562949953421303), 251 PORTABLE_LLU(562949953421305), 252 PORTABLE_LLU(562949953421307), 253 PORTABLE_LLU(562949953421309), 254 PORTABLE_LLU(562949953421311), // 2^49 255 PORTABLE_LLU(1125899906842615), 256 PORTABLE_LLU(1125899906842617), 257 PORTABLE_LLU(1125899906842619), 258 PORTABLE_LLU(1125899906842621), 259 PORTABLE_LLU(1125899906842623), // 2^50 260 PORTABLE_LLU(2251799813685239), 261 PORTABLE_LLU(2251799813685241), 262 PORTABLE_LLU(2251799813685243), 263 PORTABLE_LLU(2251799813685245), 264 PORTABLE_LLU(2251799813685247), // 2^51 265 PORTABLE_LLU(4503599627370487), 266 PORTABLE_LLU(4503599627370489), 267 PORTABLE_LLU(4503599627370491), 268 PORTABLE_LLU(4503599627370493), 269 PORTABLE_LLU(4503599627370495), // 2^52 270 PORTABLE_LLU(9007199254740983), 271 PORTABLE_LLU(9007199254740985), 272 PORTABLE_LLU(9007199254740987), 273 PORTABLE_LLU(9007199254740989), 274 PORTABLE_LLU(9007199254740991), // 2^53 275 PORTABLE_LLU(18014398509481975), 276 PORTABLE_LLU(18014398509481977), 277 PORTABLE_LLU(18014398509481979), 278 PORTABLE_LLU(18014398509481981), 279 PORTABLE_LLU(18014398509481983), // 2^54 280 PORTABLE_LLU(36028797018963959), 281 PORTABLE_LLU(36028797018963961), 282 PORTABLE_LLU(36028797018963963), 283 PORTABLE_LLU(36028797018963965), 284 PORTABLE_LLU(36028797018963967), // 2^55 285 PORTABLE_LLU(72057594037927925), 286 PORTABLE_LLU(72057594037927927), 287 PORTABLE_LLU(72057594037927929), 288 PORTABLE_LLU(72057594037927933), 289 PORTABLE_LLU(72057594037927935), // 2^56 290 PORTABLE_LLU(144115188075855863), 291 PORTABLE_LLU(144115188075855865), 292 PORTABLE_LLU(144115188075855867), 293 PORTABLE_LLU(144115188075855869), 294 PORTABLE_LLU(144115188075855871), // 2^57 295 PORTABLE_LLU(288230376151711735), 296 PORTABLE_LLU(288230376151711737), 297 PORTABLE_LLU(288230376151711739), 298 PORTABLE_LLU(288230376151711741), 299 PORTABLE_LLU(288230376151711743), // 2^58 300 PORTABLE_LLU(576460752303423479), 301 PORTABLE_LLU(576460752303423481), 302 PORTABLE_LLU(576460752303423483), 303 PORTABLE_LLU(576460752303423485), 304 PORTABLE_LLU(576460752303423487), // 2^59 305 PORTABLE_LLU(1152921504606846967), 306 PORTABLE_LLU(1152921504606846969), 307 PORTABLE_LLU(1152921504606846971), 308 PORTABLE_LLU(1152921504606846973), 309 PORTABLE_LLU(1152921504606846975), // 2^60 310 PORTABLE_LLU(2305843009213693941), 311 PORTABLE_LLU(2305843009213693943), 312 PORTABLE_LLU(2305843009213693945), 313 PORTABLE_LLU(2305843009213693947), 314 PORTABLE_LLU(2305843009213693949), // 2^61 315 PORTABLE_LLU(4611686018427387895), 316 PORTABLE_LLU(4611686018427387897), 317 PORTABLE_LLU(4611686018427387899), 318 PORTABLE_LLU(4611686018427387901), 319 PORTABLE_LLU(4611686018427387903), // 2^62 320 PORTABLE_LLU(9223372036854775799), 321 PORTABLE_LLU(9223372036854775801), 322 PORTABLE_LLU(9223372036854775803), 323 PORTABLE_LLU(9223372036854775805), 324 PORTABLE_LLU(9223372036854775807) // 2^63 325#endif 326}; 327 328#endif 329 330