Строка поиска для поиска комбинации отсутствует

#python #hex #itertools

Вопрос:

Я пытаюсь проанализировать строку шестнадцатеричных значений, чтобы найти комбинацию, которой еще нет. Я пробовал использовать itertools, но не думаю, что использую его правильно. Есть ли лучший способ сделать это?

 code = itertools.product("123456789abcde", repeat=16) for key in code:  print(key)  if str(key) not in codegen:  key1 = key  break  

Пример кода

 00b5324b212058609868022188439860d860186158612e4b00219960022159610121f02299502b49196001219960352000f044f80222904214d00621196600f034f8196e01211966002018661a6600f02cf8196e196e196e052000f02ff801210842f9d1002199601b491960002159601a491b48016001219960eb211966a021196600f012f8002199601649144801600121996001bc002800d0004712481349086003c880f30888084703b5996a04200142fbd001200142f8d103bd02b518661866fff7f2ff186e186e02bd00000240000000180000070000035f0021220000f4000018222000a00001001008ed00e000000000000000000000000074b24e7a00200420f7010010c3010010c5010010c1010010c1010010c1010010c1010010c1010010c1010010c1010010c7010010c1010010c1010010c9010010cb010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd010010cd01001000be00be00be00be00be00be00f04bf8103800bef2eb8871641e0010801e00103402001090a31ae700202149086006c881f3088810471f48006800282fd10da40ecc002902d000f012f8f9e71a491b4a002000e001c19142fcd119498847194988471949884700befde701c901c29a42fbd37047801e0010c000002030030020f02000100000042000000420f020001000100420001004200000000070470b4801f03af90047eff30580c0b27047000008ed00e0000000d03003002004080020050e00100d030010d10e00105756000006005250abb36053171e001006005250861c0302221e0010060052505422a29d2f1e001005005250de65f468f0200010f8b5c04610b5064c2378002b07d1054b002b02d0044800e000bf0123237010bd3004002000000000c01d0010044b10b5002b03d00349044800e000bf10bdc0460000000034040020c01d001070b50220d02400f04df80423082624060320636200f046f8002201210320a66200f02af804256368fa206561334206d100f02afbfa20a56100f026fbf2e7800000f022fbfa20a5618000f5e7084b8200d218402310b51468c0006340c02423408024640122431360024bc018416010bd04c0014000400140094b8000c0184b1e9941531e9a41c900036892001143594080230c225b011140184301607047c04604c001400123d022834010b51206936205219361fff7caff10bd0000eff3108072b6034a1368002bfcd0bff35f8f70472c0100d0bff35f8f0022024b1a6080f3108870472c0100d00722cb08c35c0120114088401840431e9841c0b27047f8b505000c001700fff7d9ff210006002800fff7eaff002803d02100380000f054fd07210123e2080c40a340a95c30000b43ab54fff7cffff8bd024b18688007c00f7047c04600c006400021044b044abff35f8f02c39342fad17047c046000100d0800100d0044a1078431cdbb2172b01d8137070471023fbe77802002030b5084d01226c6a0023a14206d8ad6a1300854202d20b1b591e8b411340180030bdc0460040054083680a4810b5091812181201090159189b185c684a680120944205d803d11a680b689a4200d80020c0b210bdffffff0f70b50c000500080000f0a6fa200000f06ffb2000064900f0c3fafff7b9ff054b2c75c018044b8000a4006860e55070bd3906001040000034900500200a4b1868eff3108272b601680029fcd0bff35f8f1b68bff35f8f0021196082f3108840bf002000217047c046a4070020032330b51c0053434c43033bc318033c9970015d0519002901d12a7030bd5970fbe70000f0b585b002930cab1c780dab1b780700056801920393002c10d1ac7b002c47d0032363432a68033bd3185a78aa73002a00d1ea7300229a705a701a70214bba68e3181b01d318019a1a60029a5a600a9a9a600b9ada60032363432a68033bd31800229a705a701a706e7b964228d022003100a8686b68984700281cd0220031002868fff7abff6e73a64211d1387d019a029b00f087fa051e06d0039b002b03d12100386800f0befb0e9b002b00d01d70200005b0f0bd320021002868fff78eff2600e0e7ffffff0f0023f0b58fb00b935d4b8200d4580c9000f002fa02000b006068eff31081089172b601680029fcd0bff35f8f21688c46497b0791002974d052480d18a1682d014d192e686f6830003900801a994100295ddc01d100285ad10021604600f074fb2e686f68ab68079a0a93e368ed689b18013b1b780b931b020343002023616368bff35f8f00221a60089b83f310880a9b93426fd00b9b29001802079b18430a9b9847089009916268eff310830d9372b61368002bfcd0bff35f8f099b002b36da2369002b43d00898099932003b00121a8b419f4202d804d1964202d901225242130000210491013103910799200002910a9901950091fff71fff002263682261bff35f8f1a600d9b83f3108880e7002532003b000c9800f0e1f9002600270a95ade7079d0026002728000a95a7e7089b099a13430bd02369002b08d000f06cf9089a099b06000f0092197b41c1e72268d17b002906d003234b431168cb180799033b5970079bd373e168013bca5c0132ca54c2e7002800d04ae70fb0f0bdc04690050020ffffff0f10b5094c6368002b09d1102120682300064a00f085fa03212000fff781fe0a21034800f015fa10bd7c020020b1040010a4070020f0b58db0079314ab1b78002709931f230600069204aa9b181f707268eff3108572b61368002bfcd0bff35f8f1f2404abe418139b30000193129b049400930397069a079b0297fff799fe02000020824203d0f3689b18013b18787168bff35f8f0f6085f31088002a28d02178002928d1000210430db0f0bd04000d1e12da069a079b121bab411d00079b1400ab4203d805d1069ba34202d901246442250006940795bae700f0daf802000b00a4185d41a942f1d8f3d1a042f1d9ede701204042d8e7099b002b06d0129b00201399984703000b43d0d10020cce70000f0b506000f0006246442e517a4197d4185b08d4202d803d1844201d90024002500f0aef822002b00121a8b41002b08dc01d1002a05d13000390000f0abf805b0f0bd002302930193104b2200009310482b00fff767ff0028eddb20002900fff7abfd0028e7d10b4b1868eff3108272b601680029fcd0bff35f8f1b68bff35f8f0021196082f3108820bfe6e71d0500107c020020a407002070b504000d0000f06ff802000b0020002900801859418b4202d804d1824202d901204042c117fff79fff70bdfa2210b500239200002101f041f8fff7e1ff10bdf7b5eff305823f231a40100001921038eff3108772b6184b1b68002bfbd0bff35f8f012634008440144d154b6c631b781a00c24094466146002231420ad0114e696a8500ae59b1420fd30f4a0c49a343aa580b70bff35f8f002307490b6087f310889a4200d09047f7bd019b07499b005b181c681c60ede7280100d00040054003080020a80700204c040020d03f054010b50100024a0348fff7e3fc10bdc046c01d0010b9070020034b596a0a00986a596a8a42fad1704700400540054b5a6a8a42fcd38a4202d19a6a824200d370475a6af7e700400540f7b504000d00eff31083009372b61c4f3b68002bfcd0bff35f8fa300194e0193002d1bd0200000f04bfb86420bd03100200000f04dfb0121200000f039fb0123a340114a1360114b019a9d50bff35f8f00233b60009b83f31088f7bd0b4ba2009d500122a2400a4920000b7893430b70310000f04dfb2900200000f019fbe5e7280100d0a9090010386005404c04002003080020f0b585b01e0004000192fff797ff8e4203d847d1019b834244d9eff31083039372b6214b1b68002bfbd0bff35f8f0125a5401e4b1e4f1b7800932b43dbb20293029a1a4b1a70019a231d9b007d63da51184aa3009e503b6a2b420ad10020bff35f8f0023104a1360039b83f3108805b0f0bdfff763ff8e42f0d802d1019b8342ecd8029b009a01209342e8d01f2302001c40a240084b3d627d631a60034b009a1a70dce70120e2e7280100d00308002000400540a807002080e200e010b5eff3108472b60a490b68002bfcd0bff35f8f01238340074a0848136202789a430270bff35f8f00230b6084f3108810bdc046280100d00040054003080020024bc918890001607047c0464000003410b50400fff724fc01002000fff7f0ffff232371bff35f8f10bd10b50400fff717fc01002000fff7e3ffff23a380bff35f8f10bd032330b51c0053434c43033bc318033c9970015d0519002901d12a7030bd5970fbe770b506000c001500002912d0002a09d0806873689847002806d02a0021003068fff7ddff200070bd220029003068fff7d6ff2c00f6e70122002330b5047b827343730268c47303200133ddb2ac4205d8002360431218033a537030bd010059435118033901354d70eee710b5017342608360fff7e0ff10bd70b5040000291dd00568032003004b43033beb185a78002a14d00026504303382818457846705e702000fff7adff290006002000fff7e4ff310002002000fff7a3ff0100080070bdf7b503273e004e430368033e0d00995d04000192fff7d0ff019b002b08d0e37b002b04d05f432368df19033f7d70e5732268002805d0032300214343d318033b9970002392195370febd70b5457b0a0029000400fff7d4ff6073280070bd70b50400081e07d0637b8b4205d101212000fff7ebff012070bd032633004b432568033beb189a78101ef5d07243033aa818aa5c8a4211d15a780270002220009a705a700132fff7acff617b02002000fff747ff6073dee7002aefd07243033aa81842788a42f7d15a784270e6e70000234b244a70b51a60234e244b244d33601900aa689143fbd1224c234b9c4224d300f0dcf8214b3360ab68db018033fbd140221f4b1f489a675a671a67da661e4b984215d31d4c1e4da168c022280000f053fea560fff7fcfa00f09cfafff7aefc184c194b9c420fd370bd08cc9847d4e7040003680834002b03d0fff7dcfe2000dde7fff7cbfefae708cc9847e9e7c04600e00040bfcdfbfe00f00040fe7f3c0000c000401803002028030020ffffff0100f00140100300201803002000ed00e000000020280300203003002000befde70fb407b5074800f0d5fe049b002b07d005a91800019100f0d5fa034800f0cafe00befde7e21d0010f01d001010b50148fff7e6fff21d0010f0b585b003920a9a05000f0000209a4240d80c241a0e1b02029201930a9a03000299019800f038fb6c43284b0600e4186368834200d260602b1fdbb20093c023009a9b012343012a26d8012f24d103221a60a3683b42fcd0039a236852015a408021e02349011a40009b21430a60012b21d9802380229b01234312011a600198002332000299666000f006fb104bad005851012005b0f0bd802212011a600c4baa00d1580029d7d0586900f0b3fa01300138fdd1d0e7032223687b4013400b600123bb40a2681342fcd0d2e7008000405c05002037b50c2000f036fafff72cfa00280ad000232b4a2b489900013388500a2bfad1294b536237bd294da86700f02bfa0122274b1a606b6c012bfcd10322254b1a60ac6b012cfcd10225210000950623224a224800f0c3f9210000950523204a214800f0bcf9204b2900204d009300220420fff75cff2b002100002200950520fff755ff00220f4c1100230000940720fff74dff00222300110000940820fff746ff0022094b1100009309202300fff73eff00222b00110000950620fff737ffb1e75c050020006cdc021bb70000008000403cb0004030b00040002f68590080024000389c1c00c00240001bb70040597307074b10309b688000c150bff35f8fbff35f8f0021034b196082f310887047c04600ed00e0240100d001228240034b1b6813405a1e9341d8b27047c04600e100e0002904d0034b1860034b18607047034bfbe7c04680e200e000e100e080e100e00123834010b51800fff7eaff10bd0000024b10309b688000c058704700ed00e070b504000d00eff3108672b60a4a1368002bfcd0bff35f8f2000fff7e9ff074b984203d0a84201d0fff7c2fe320029002000fff7a5ff70bd240100d0cd010010f0b585b005000191eff31083029372b64a4a1368002bfcd0bff35f8f2f00484b10379b68ba00d458464b9c426ad0019a944200d17fe0444ea31b2f2b62d82800fff792ff002103902800fff7a9ffbff35f8ffff740f80090002803d0874201d0fff786fe012322000c219a43130037488c46921b52415043000d002206219e68019f5956be420fd1002915da0099002944d1002a40d0ff3191712d4991802d4a11781070997129e0002927db624651431a00254b5b18e1e70c204843224a1618b7689f60f779df710627f7579f71b7797f2f1ed8b688d21a7605361580191218e0201205520d000202439a800c224a43154b9b18174a10781170987128000399fff74eff21002800029afff719ff05b0f0bdbd221202e8e70a4cc0e70e4a0f49d21a083a5002400d014399800c4952080a43da80e2e71c00e4e7c046240100d000ed00e0cd010010a4020020aaaa000000bdfffffa070020de02002000f0ffff00f8fffff8b50123034304001e00fef7b2ffeff3108772b61c4b1b68002bfbd0bff35f8f1a4922001a4b521a524153431b0d5bb29c46184b9a688300d258080015000022b54214d1134a14499268d150134b1a78a27162461a70bff35f8f00230a4a136087f31088f8bd01320c30042aeed00623c3566345f7d10c235a43f33389188b71074b8b80e2e7c046240100d0a4020020aaaa000000ed00e0cd010010fa07002000bdffff054b064a1360064a136053609360d36013615361936170478080808000e400e004e400e0f8b504000c2017001e000d0000f0aaf81c494143380000f0a5f8069a3304120313432268002a0cda3f2122680a40aa4207d1a2681205120d824202d1e268002b1bd0114a944219d0802252010f49104e0a6010490a601700b1688f43fbd1c022211d92010a4321212560a060116021680029fcdae36008231360f8bd80229201e4e7c04640420f0000c0024000e0004000c0004000f000408023024a9b000343d362704700800540aa22064b12011a602f220549da60054a11605a68002afcda7047c0460040024000b0fa000060024010b5002801d000f0dffb10bd1fb5094b1c68002c09d00122030000910648524203a9a047012004b010bd00f0e7fb2000f9e7c0468c0500208d14001001480421014b1847f0020020f9140010142310b50100188804331b88984710bd162310b50100188802331b88984710bdf8b50e00040000270125b74201d12800f8bd2068fff7e4ff01c4431e9841404205400137f1e70000114a936f9b0813d210665166002905d0ffe7ffe7ffe7516f106f704704b5002801d00020c04300f023fc002104bdc046f0b5146e556e576f166ffff7e5ff1466556657671667f0bd000000d094464e4a926f9208624601d230e0c046f0b54a4eb56f6d08fcd3346e756e776f366f00f025f89446444a14665566576716676246f0bdc0469446404a926f9208624601d258e0c046f0b53c4eb56f6d08fcd3346e756e776f366f00f04df89446364a14665566576716676246f0bdc046002b24db11d000293eda00b5c943404200d1013100f038f8c943404200d10131db43524200d1013300bd002aebd1002801d1002905d00020c90fc90701d1c043410800b500f0aefb0022002300bd00b500290adbdb43524200d1013300f014f8c943404200d1013100bdc943404200d10131db43524200d1013300f005f8db43524200d1013300bd002923d1002b18d1002a0cd0bc460d4f38667a6600210023ffe7ffe7ffe77a6f386f67467047002801d00748010000b500f074fb0022002300bd02000b00002000217047000000d0ffffffff002b00d0bfe0130c28d1002ae7d080b4114f39667a66ffe7ffe730b4040c7b6f396f1b0423433b667a66ffe7ffe7ffe7c04684b27b6f3d6f1b0423433b667a66ffe7ffe7c04600232c042d0c7a6f386f00196941b0bc7047000000d0f0b594460025140e01d112020835140f01d112010435940f01d192000235d40f01d152000135d40b0134254f7c66254c3c660e0c93b2ffe7ffe7ffe73c6f6643360c7703be467343df0b5b04c01ab941130c7343db18c91ace086643360cb64493b273431f0f1b01c01ab941130c73431f0b1b05c01ab941860d8f023e436643360c092d24db520a7243801a7703460a6643360c16235b1bde40df40bf1964466643821b7046043506330100d940a840c01900d30131a24206d20023f0bd0000000000d0ffffffff121b0130f3d3f1e709277f1bfe406446a2b27243801a00d20139220c7243130c1204821a99410b007046043513370100f940a840801900d30131002b02d1a2420ad2f0bd013000d30131121bfad2013bf8d1a24200d2f0bd013000d30131121bf7e7f0b51c0c00d080e00cb400251c0a04d11b02160e3343120208351c0b04d11b01160f3343120104359c0b04d19b00960f334392000235dc0b02d192185b4101351c00971864410134464f7c66464c3c660e0cffe7ffe7ffe7c0463c6f6643360c7703be4697b27743c01b00d20139c01b00d201399fb27743c91bc91b170c77437e04ff0b801bb941ce086643360c0c2d33dbb644120b1f053a431b0b97b27743c01b00d201399fb27743c91b170c77433e043f0c801bb941860d8f023e43664329277f1bfe400c3d7746af40bf1930bca2b2abb272437343801a9941220c7243130c1204801a994102000b000137001ba941f9d2781e0021f0bd0c277f1bfe4077467f0baf40ff19e0e700245d1c07d0144f7d663966ffe7ffe7ffe7ffe73c6f95b29eb265436643401bb141150c1e0c6543664336042f0c3e432d04401bb141994204d202000b0020000021f0bd01d19042f7d3801a994101349942f2d3f6e70000000000d0ffffffff132370b51c780f4d012c0ed100230e499a000133a950202bfad10b4bab640b48fff78afd0a4b186070bd012cf5dd0948fff78afd80220100280000f08ff8022cedd1eae7a0050020f91900104c330000a00600205344000007b5604601880a0a0230df2afad1c9b2820804d3028840880004104300e00068014a5050039007bda005002051434343c9188c46110c83b24b4310b4040c614392b280b2504362431c041b0c001910bc59411304120cc0185141614470470000132310b510481c78fff742fd0100012c13d10e4c5422200000f044f815230c4a990001336250202bfad12262e2610948fff726fd084b186010bd012cf7dd8022024800f02ff8f2e753460000a4060020b51a00104c330000a006002007b5604601880a0a0230df2afad1c9b2820804d3028840880004104300e00068014a5050039007bda406002001480421014b184700030020f9140010014b1b681847000000030020014b5b681847000000030020030010b5080011001b68984710bd0000f8b50c000021437c0500160008008b421ed1110020002b689847f8bd002927d0631e5b5c0d3b5a425341dbb2625c4f1c0a2a0cd1002b0ad1814203dd091a2b68201898470d4802212b689847380039008e42e3dc86420ddd311a2b6820189847a419013c23780d3b5a4253412b74d4e72b7cdbe7002ed0ddf2e7c0465f1e0010d02337b5084d1b06280001a91c6800f0fbf8002807d1019b64b29c4203d0280000f0faf801203ebd1003002010b5024800f0d2f810bdc04610030020f0b585b006000d001c000092fff7daff01906b1c03d1300000f086f80500144f002c00d1134f144b1c68002c06d1019b002b01d0fff7dcff05b0f0bd2368002b13d00e4b1b68002b01d09c420dd12a0031002000b847009b002b06d002abd91d0a23012220000b70b847e468dde7c046091b0010191b0010840500208805002013b56b460400d81d002301211a000470fff7b6ff200016bd054b10b51c68002c00d110bd6368002b00d09847e468f6e78405002070b5050000f036f804000100002328000122fff79bfffff7e5ff200070bd000010b5024800f004f810bdc046fb07002070b50024092688b005003200210001a80094fff711ff3200210005a80494fff70bff4b236a466846137004a90d2200f03bf81521082228006944fff703ff08b070bd000010b583070ad00300032102e001330b4205d01a78002af9d1181a10bd030019680c4a0d4c8a188a4322420fd15968094a04338a188a43224208d15968054a04338a188a432242f1d000e001331a78002afbd1e1e7fffefefe80808080f8b5c0460000000001b40248844601bc604700bfd101002001b40248844601bc604700bf4501002001b40248844601bc604700bf7502002001b40248844601bc604700bf7502002001b40248844601bc604700bf0301002001b40248844601bc604700bfc1000020486172647761726520616c61726d20256420616c726561647920636c61696d6564000a2a2a2a2050414e4943202a2a2a0a004861726420617373657274004d696e53697a6552656c00626f6f74325f7732357130383000312e332e30007069636f00627574746f6e5f626c696e6b004e6f7620313420323032310006005250bbff3cb61d1e001006005250e182887f091e001006005250d3f07542fe1d00100d0a000000b4020010a80200109c0200103b1e001090020010471e0010531e0010d02330b5002400211b061c570568eff3108372b62a68002afcd0bff35f8f057902687f2d06d90471bff35f8f116083f3108830bdbff35f8f116083f3108820bfe4e7030010b50068eff3108472b60268002afcd0bff35f8f04229a56002a0cdad0220120120612681a711b68bff35f8f00221a6084f3108810bd081ef5d000200a60f2e70168eff3108372b60a68002afcd0bff35f8fff2202710268bff35f8f0021116083f3108840bf7047084a10b51378002b0ad18023064807495b051c68c45004338b42fad10123137010bdc046b80700205c0400100001001010b5024b0133984710bdc0465c040020431e9841054b02301b6800025840c0239b001840024b18607047c0460c8001400c900140f0b51427182685b033880190029138882149140098473388050020493888984733881f490390388898470600fff7b6ffa847039b98470020fff7d0ffc022230008205205123f2100194307d10120fff7c5ffb047fff7baff05b0f0bd916a0d00054039420bd0002c09d0191b0d2906d80199013c09781166019901310191002de1d0002bdfd0116e029d013b2970290001310291d7e7c0464946000045580000464300007047c04610000000940200200000000030030020ba0700200000000000000000ca070020000000000000000010000000000000000000010000000000000000000000020000000000000000000000030000000000000000000000ff000000000000b5486801318e460047704609380149884700bdf512001000000000503300004c33000054330000523300004d5300004d43000053340000433400000000000000000000e11a0010c9140010a1190010591a0010ed020010a91c001000000000000000000000000000000000  

Когда я запускаю этот код, я просто получаю

 ('1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1')  

Это заставляет меня думать, что я неправильно выполняю итерацию с помощью itertools.product, что, в свою очередь, неправильно анализирует, так как ключ, который он ищет, всего 1 16 раз. Моя идея состоит в том, чтобы начать с 3-х шестнадцатеричной последовательности и повторить оттуда все комбинации длиной до 16, пока одна комбинация не исчезнет в codegen.