1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.bluetooth.btservice; 17 18 import java.io.File; 19 import java.io.FileOutputStream; 20 import java.io.IOException; 21 22 /** Class to generate a default Device Bloomfilter */ 23 public class DeviceBloomfilterGenerator { 24 25 public static final String BLOOM_FILTER_DEFAULT = 26 "0107000002ED430FB68A222B10850886C54" 27 + "FEC4A6E8D81843EA13122CCB2C1AE2B8AC7" 28 + "11B34170ED4F59597F3D6B1C9DC2A7D4D89" 29 + "243B434A8160E65281052C8ACB84DEAD3E1" 30 + "347081BCDAC3D2C121CDF0F1B8265B2C9EB" 31 + "15CD5C0C878E8B996875102710D0423C6B3" 32 + "BF09A1036E815A2F15C62CC2D2111B70252" 33 + "061B29622E4D7C9CA72333E8A3E41402F7F" 34 + "400FA0EC8EA1971B6EACA094204AB00F870" 35 + "851AF6272A612121A66CA6D0EBBB34BDB87" 36 + "AA006099C461A9AC8B88ABA0C603441FFA7" 37 + "50463C44CD2436B087E3AACBE3E8152B439" 38 + "347F6DC31F3AB0936B10DFEA69A40582CD2" 39 + "051B749D720818E521C5BA187E2374EA39F" 40 + "CC199484406D045A81681322C44D80D5D6B" 41 + "6B0410410F83521533355C9860100D32C46" 42 + "1031FDE98426855108E4AAB14F019A6B042" 43 + "905A0D511F34852090DE36B1ED82945748E" 44 + "C414833BBF042D5A095D9C54E317271D212" 45 + "BDC1DC6588D45891EA8C86D5625202F6134" 46 + "7A599CA630A138212E04093102A67A55000" 47 + "984031EB7163110E54DA6D13786F1752829" 48 + "20A4A7C0C642F29A3BCB3859B6D28D5E79A" 49 + "FC41D6E89131BAFAE5D6CBC85ACC009B510" 50 + "51218043134F8B698D4FF8C922B1B782ACF" 51 + "E63F3CCDFB42029F462DC4877E52D46A6DB" 52 + "41C0CC519CD40ACA47D3088A069DB550C3F" 53 + "F3FA460CEEF4BE583AA825E4819093BD943" 54 + "69954C8258EABDCB4F090B8674495E1AB9B" 55 + "F42234CD733102839730D80B1884BB29E08" 56 + "8CF776BC6E4AABB88503FC0264140AA9C8F" 57 + "F868C238EE016C0FDFAFEA526416D97C674" 58 + "8EA0583A8684B3684637CABA7F5B2BE11D8" 59 + "CB7182E3D02F807EB920345264443F3120F" 60 + "912D36847AE48A85AB0CD9C3261F1116370" 61 + "72E86301D06078CC90A7224C08E2A550CA0" 62 + "AE588800A1CD5039800F3EA7110887C65B8" 63 + "9B85FB3F9448C6722930F46104CD93E6A8C" 64 + "2C60368AC04F20569C696BFD011FE06D204" 65 + "00F610D90B60FF206AD2551A8CF902F9C62" 66 + "5013B1014C93B151258D287C7C08F1CAB45" 67 + "0D5B05245ED261C874A152D99475432ACE1" 68 + "210AF4038834C08D53CABEDA02317809250" 69 + "B30701E9DFFCE10166D4031C96F181D7B9B" 70 + "49356A91C4DEF6DF2C0F2D6FC9271E9514B" 71 + "04108199D44643FAE4454BCCE09C8826DF3" 72 + "4240B42A62E0DC5E215C1F679797E8639DA" 73 + "15847E0F28A50F820588CC48C4BA4043310" 74 + "4213801D9DC0258BBAC042126C8E017160A" 75 + "796CE89E53699D428053D4F2BE6FFDAB155" 76 + "AA899C54E308B8901D9C2B63B9796128217" 77 + "1920D987A41938B2746BF4C0661B750A1F7" 78 + "9C5134AC857BEDB747E56CDD31D8C4B9294" 79 + "39EF30707F00D4C9EA02241C256005D3C29" 80 + "BB03FC571AEBF38C43251110143D7092A91" 81 + "38162880940706D91D291B1136EBF7794F4" 82 + "417D5029B7898C3874219400038761CE0B2" 83 + "A9C824962CE0D4B013AE3D444C088B7F65C" 84 + "B5D2384ACE4BB8C267A887120E9282D9403" 85 + "6BDB5052EBED88A286F69C27698E90A58E3" 86 + "98E3026250BF0CCC3B5E8042CA9200A4B21" 87 + "E02E70D0C231EF00F2B10E042336E00B8B7" 88 + "F62BEEAB46BC9170683217D063800DC70FB" 89 + "66B57F1AE81065447283DB7822A313CBB87" 90 + "C9A221A1558D5293F77EFB4C1813A977AA1" 91 + "EDCB8035050C2E5E73AF8260BA7F5A33A85" 92 + "9B81FC04CA2051C19D1020599613217EB8B" 93 + "62A20808E6C5361C5147E434E624859F610" 94 + "CE7E08F05933F94389CA00E58033283C2BF" 95 + "6403A246EC2B5668F06DA3A065668D2BFCB" 96 + "1FC80565382916708F46B025805DAE62B1E" 97 + "150A3E33D66BA4F6F202E92C852A44A6F60" 98 + "2D70258BBF8468DDBE2E0E8D41D8AEFAD83" 99 + "2364DC68AD9279CB854DD389A051210B05A" 100 + "AB6CC85FA4E14E05EA81FE9C6936026A2CB" 101 + "98A7508881F1D9725CE3D45445E69D9B60C" 102 + "20B89490144A27A28818B8DDD068A84BD70" 103 + "555AFEE4A1861DCB1166E813F689745A590" 104 + "AC7DC27093800ECAB801AC35C9033EF1E36" 105 + "730D18B1929400F59D3218D0A23252D924B" 106 + "54AA1C0A934B7EF575ECCAF434D2931A049" 107 + "0AA50195566981B0201935048A6B1BC7894" 108 + "B5553A4989E0EF43A744F4D7988D3AD1D6A" 109 + "14AE34B91820486FC598AA0DCEE5A81AB69" 110 + "511FF792929B0A44BAC70AC0691A8318140" 111 + "9C0EECF9E9CE12009806AD0854408C974A0" 112 + "8273FB817BB4C0405A2F6284D6C141EBE24" 113 + "D62652275C12C3EC16261BAFEBE14C547BF" 114 + "0C682BA901C1860560A0D501380BED06102" 115 + "A599F0C9504B1A3E51206C9C6A68AE9A7C1" 116 + "91010F606EA484957934A7EFE9A0C8750B8" 117 + "B60646C154A31139ECD873E6D81DD66E724" 118 + "040AD402015115CB91689207A56D4A63341" 119 + "38E46EC16E7E1F8BC818F4210B2AE312438" 120 + "0023E8C1A7DEA311F970BCF0AE0E3113F07" 121 + "6FB0F32605614CD4C1BA9E01BEC3AC6CBC9" 122 + "C902B4840C4113D93B10E8B44C58A7CAA41" 123 + "8048639110835C9BCD23565C783D1B521E1" 124 + "88EC2C07091AB2D7E9F934C80A8672D7F20" 125 + "D216EC38ACDD28FF93BE9F27615C3414250" 126 + "30D7EA9019A024DB5AD84A880FD15A9998C" 127 + "679032F08C59035C44C05AE152C68E20D68" 128 + "9EE31D0F38C0D2A3B0251DA001C999B2638" 129 + "263005FF8517186E5CB4CB13433F137CAB3" 130 + "84C55D87D11327848D56C033C820A8C44C5" 131 + "54B214B6E6D42E122C2CD1E3047EA130036" 132 + "91411EB1879C34A86E200BD02657A38CF8F" 133 + "A355A52C0701133DAEC6D259CC708ECC042" 134 + "8B0DA3B1A84EF5C4C58EB47D93B23DA609A" 135 + "D81E3521A679086612B45B3F1E1540A5225" 136 + "1F209254F833815900D00E6A25C9BB74820" 137 + "43DC305C65DF58C41268060D6F0AC8791B8" 138 + "61332C4A624587D929021009D65003188AC" 139 + "87C1C8A02CA65171462E1D43229D10E9EDD" 140 + "40319623E24AE71B1B551132327CCE3A8E2" 141 + "234A95C360D433D9E433B997005F2A03580" 142 + "A42E9923D6B79982252753745E49908EE84" 143 + "E2AAD69FBDA207292505EEF31E7102BDCA0" 144 + "37FF4AD4BDA92F89254007FF4AAB9165704" 145 + "EDFD2CBA51E2F484E5AF501768D48969B0A" 146 + "A8C12CD39F37F889017D003F0A7EA5D9029" 147 + "D60905CC34042C5F14882A863874826131D" 148 + "9EC26EFCB2CA920840C1CFD9350492511F3" 149 + "A3E019EB248E5F44CF45CC6936CA5252DAD" 150 + "1C8E138327B33C891D130D06101D0701A0E" 151 + "B1B1C914271F030220B7FFC2BFAF39DB942" 152 + "1BE8942129E5D0DB7467E7DD75AC922E3EB" 153 + "F3C61200C1840C695274313254B60CA51CD" 154 + "6B42A470B288B34180CC138BEC4C211682E" 155 + "13D0700366CA94186567D3892E1D630FE16" 156 + "3278CD0E766ABFBC080326AAAFB25CE8117" 157 + "9D564C02DB8548435F94A3002734CB034D1" 158 + "031A8345D28D1C278C5B4E6537F721F97EA" 159 + "246948B906A1F26424CE8460418492268AA" 160 + "CD83AC4731D08E889AD140D98406DC0413D" 161 + "D4A8A113812330F0A0838C64D5CF054C08F" 162 + "6FD438A5028AAA1F350884E24AC428E30D1" 163 + "B68A2AE577D7DC1C7032ABAFB14A4E2166D" 164 + "38AB0A63198D805798B1E2C89F9A108E5B8" 165 + "3A8477790642C0E21CE64DFF35A11F76582" 166 + "019100F10A8BEEF14F45A934870452F761A" 167 + "6C1C9FDAA468500B13AE2A66D89CA6CF43D" 168 + "751D63C5B6A0E0E72258324CE8A151D7D10" 169 + "E625088765C2B16A0B8C82A7E5E29993224" 170 + "9C1712402C1940ED4260DF158E4120A0EB0" 171 + "1945004B549EB48D1608349D84EA510024B" 172 + "30E8E26E07D7342ED3E01000F43B8605060" 173 + "7ABA83B7228D809D201CA62CCAB0DF8DA56" 174 + "A5AE0409D0C4037FBA5AA5B7755095009E2" 175 + "BC5B9B4696E6DDA14A0F9BBFC55C44E68E8" 176 + "E0E41D0658A2C32C0CB8080059245197134" 177 + "C2B354EA4CD38C456AD0330C03698D58A74" 178 + "B88886318FC1CA8F40263882A83DADE17B7" 179 + "3104489FB0743298EE3640978DAE143801A" 180 + "F3AC66D804A5D43CD0336474B0B2713B04B" 181 + "8A910CD666057C20DA48EA4E7AC2180566E" 182 + "44D452B947ED185B1D1A81B73EE95AE469E" 183 + "2F924DA3061132024898F6D51487D550A18" 184 + "90AB6CE02841C20A018AE769AB4471C05A2" 185 + "298551CDEB1810E6D95245C19BE8D10340B" 186 + "3208C6D4C5F6285532C3520D8358AED57CC" 187 + "27A122A770C08AA8C4CB0B8A5D3ABFCB6D0" 188 + "F1F7D5AF25230019D21D7BF2B66578E686F" 189 + "8622C762D2A5E1E00651F3B18C6272E08B9" 190 + "87B906ECAAB2A7A1B5C5095812BF7D458A8" 191 + "4BA46A1DA1D686AF1A4241D1112BAE42906" 192 + "C6FBF47455E7817B48A35B1281AEBC631CD" 193 + "C90101F94042C2F728BD70F26CFA5730D3D" 194 + "44E85625A8A40BA000953860532C4F9ED85" 195 + "F181A84106C0708302E2B1B206D5184356B" 196 + "7223AB7D8D5368C1714A55D1A21F204621C" 197 + "399DB1FD90A40CA0E052C6721016C44A286" 198 + "AD4EA381F2C7A66591C927E853E7F7C4EA3" 199 + "DB95E0E985B3A530C83F923FF13E4968F86" 200 + "87191028F92CE213B1D0F7015E6F2BDDC08" 201 + "0F63E3022759E32FE5104A95CB4CBC418F3" 202 + "B565D616AB8743C29EF5BB550B7794A1C96" 203 + "A96588482405440B231AFEE4444F5970A9B" 204 + "AC96B2A31F2E3AE968B4E0590385C7C0B5B" 205 + "EC8DC44B8D05714C83BCB9D4C500351AC74" 206 + "941B7C11956789711B8EB522902604A8CA1" 207 + "179141F286BAE8F677580071B86C42C898D" 208 + "7B0A186DD5E28C6FF608013098D0F0BA1E5" 209 + "EC62E034CB1B072A3B374809A702651D942" 210 + "114244791B1D2E5FA9E300E62485A3A3E30" 211 + "E0F560C2720C7B66C33CB878DACE0075078" 212 + "15012A1A44D0B12159DAA84CDADB74D1708" 213 + "0416279C5B807CA091973237E3563107201" 214 + "F5E6839E17901C51410C0CD1CD622BDD368" 215 + "4AC9904BFACC534A7E0C1A0458DE01B61A3" 216 + "681EE3100AC484DB648429B6824D7CAA65E" 217 + "262DE81562001E91B5219C6097F21472913" 218 + "93EE8D85CDB11A220552C3F449B4288F189" 219 + "2C47BCD944F0F9B29209EDA926848AC5B26" 220 + "C8C1D6FFB217469A028D87C4077E60A1F14" 221 + "318897F09213411637D06046BCEA8632D54" 222 + "3882C33BD526DC49078D09A4CB42B9775C2" 223 + "1593177B2E14C62AA9CF5FA586F2393E102" 224 + "55CE104511638AC9D1B20040C0463DAB53B" 225 + "F24211001184B59E91DB35D2D441CCF1788" 226 + "106F35D7252DFDDED10F268690442133349" 227 + "E51CD0E841174EA2251B5A4ACAD98CCB799" 228 + "F4EDCBA1AE1EB89969486BB69E2A616AB50" 229 + "2D3D2502CE50C9C4178D0053D40355637D8" 230 + "E396E52EE08A5C9638479518DB841F2F8A2" 231 + "628F5666BF92B15943580B76380D1458FF0" 232 + "0805CB004D8B764F3C32A3ADD8BEF2C2004" 233 + "518E3A65C29CCDD9044957D3144B04B7E94" 234 + "20D12387AC31E2B34F6469E408C2705C5D2" 235 + "E09D4D5102FC159D5A14B616279B6523BF3" 236 + "658DC25B9034086309210FAD465EA3D04F0" 237 + "2A0FB66EA012C41977819006550A9FE0A97" 238 + "81A0856CD52161D4AD4AA8529D102B94098" 239 + "EB23431829448F0085948922BC4249C1E28" 240 + "CDA9AFB811130A5AA3920122152E40031ED" 241 + "6BBEF0BF844390938E1446FC92617029922" 242 + "D8F4183E236F9A90A2823CC93BF0CEC2CC0" 243 + "E1632545C8826894913A823104785E23F03" 244 + "88BB3D8AC4D660008F7CB4D6A2FB47161B2" 245 + "223F32857568BD12E0D5827B6C2C73B0860" 246 + "442A996812BB0D348D64599F6948087D521" 247 + "63FB0A0F40D7C9E3592BFDCD757F5813E31" 248 + "3AE469B10A39BC09305CE43AD6DA1B83AEC" 249 + "75DEBD0B140D25522D72648048549A7E1A8" 250 + "8E160C611C0A293C010351280D3F543259A" 251 + "3B7DB10EC4648F2123EA51CCFB4095784A0" 252 + "C3BB0D1605C3629150A049022A111643BCC" 253 + "3003C94994B068448FE9B27040DD2057B78" 254 + "551639838674F9930974A90F10702E02BE4" 255 + "9384E853FA120E2287B6887DD09060778C0" 256 + "892C3916633FEBB145411982CB0984C849B" 257 + "E94AAABC539EFD863CD1201D082D4402181" 258 + "37DD4D7A44C2C37EA854195CA15ECFB98CB" 259 + "2811539846B5C836EDFE48D2632F2782948" 260 + "90C953882F1B23DD5F2BCA622693494CC70" 261 + "9094330A5CE3478D8C008740DA172E60ED1" 262 + "DC8C03523BBC1456844D43DC51B2FE5564C" 263 + "C91300EC1FF304A53A6B5C0A341ED555968" 264 + "BFF1FB24081EB87A55F392013384EB5D62A" 265 + "75AAE6A21CCE0661B4A94B0441087C2B524" 266 + "811A47669101A8F0816064C02204B608176" 267 + "61F637487BBC592300F7804DCD1891F903C" 268 + "F42352BD8A7D3B2B98041E8196011044AA8" 269 + "D6489CA7825DCD1ABF5567E9BA28A5963D6" 270 + "0462BC40D16E80A2FCD6D1A8FAA24C9EF80" 271 + "97F1874453DEE373D94902A1FE608537C11" 272 + "71A7ED0383B3FF4271255A7D91D3826E696" 273 + "78FE6D9D1744861756D0E78A1AE051009C6" 274 + "9A98BAB05C10EF52CC26741F4228683EDB2" 275 + "FDA694D4247CA9B6B0F091E077C00F8A9D1" 276 + "3AF90A8534099ADE9603527B82449965ED1" 277 + "3D14C8BE9CB8D323F20D417240304867230" 278 + "CABFD9BE036C1097507B0CAFD2D6F3483B1" 279 + "AE98E429642C68034094803A0CF8940BC20" 280 + "6019CB7D87A6CECCCC82E01805A9F84A730" 281 + "0F8B4C531614DAFD380B2B1A068A5B0B82E" 282 + "4A6C8344A7C90E124039D68F1231C812137" 283 + "155FB3422CB8DEA7DFAE701D34782412131" 284 + "CE3A8501E119923349025B0F18792112EA8" 285 + "520E9A7C160C007194C81BD365B28F6AC36" 286 + "887D0C0D6059D949D532D10D2F080FFE052" 287 + "E01F95ECD51B78A80A983357F2B005E5238" 288 + "C80588758DF87A1758A161152440D30B655" 289 + "B30561CB503EE96E0507DFB4D527D583C1A" 290 + "C892A689716A242511EA04AA20321747286" 291 + "12C3D766D69303E8F888395EC4BD3530D4C" 292 + "F87FB421BB2848948590CB3EFE0E29E6F51" 293 + "5335618CC91CD8C20FB42EC6DECDAB08C3B" 294 + "CE47302A49FD044CE236BA428846B610C1B" 295 + "A77442796906F5A22002AAAC8BE5AD60060" 296 + "CC6B32A4B945B94CDCEFAC8902595268020" 297 + "B19326A878089E9811DDCB17C665F094677" 298 + "B60FF7415F4E77A188F7A8AC44652030DB1" 299 + "5571C45488F133AF3F604B207D3F5CAF044" 300 + "19016D60194BBB311A3B01E278A41B289BD" 301 + "B3E94481209D0E8A4828604228C6DA7AC10" 302 + "9001D8A8010A08ECC2C7BBB731243141822" 303 + "B100E67C8433A578B7F7888123B47C12706" 304 + "7E52FAC6E8C1EC59A47799DC044A8DBD09B" 305 + "2B671581A02865A9063025A44A0B464A4D2" 306 + "82611438D52AED601375CCB946F80500901" 307 + "730D4098F6E5859812BC9D28499BCDE4A00" 308 + "51130306428751C06E426EC77573CE27A98" 309 + "0930624C01CF11A40809C10ABA90A230B24" 310 + "6A3B1D3A1522326DEC5B1172AFCD70541AD" 311 + "4DBE51C215D4045A7212070BE167E0766EB" 312 + "C4C7BBE832CB940CD80CB0567B81E670400" 313 + "C858D7798A9081C11C866D5E68894996B17" 314 + "DA6388450B6B629668E14B2379F5A244CD2" 315 + "2828E500814E6C8107981F7F213E2A13BC4" 316 + "8231B90EEA2E81C1716CC30C4338CAC0FC8" 317 + "B63AE5E58BA2F190A0F40449F638EBE94A1" 318 + "9836A8F48B968020E8C7955546592134B92" 319 + "D02F723173BD9422F2DC80A8F00405FA216" 320 + "86B22CA290614B7F4AF13A4E15634F8EF6D" 321 + "7D2270898202CAC10B801414A40323C4430" 322 + "7F0633895BA826BF468A641E1758328887D" 323 + "33456402AD8C1688C539044B90534C9308F" 324 + "27963B0FE389A0526577180F22B49852156" 325 + "86E3B6FD8899632D501E9700F8E2F61B218" 326 + "24023D4F0B6AC85FA7F0A131443AAAF5381" 327 + "3E0B2013013F1E8AB763991D2255BEA9C7B" 328 + "5039E80355605C6F017E8500A9F082B65DA" 329 + "523EB8B9CE6D3226B9128D54AAEB7D94FE4" 330 + "3A425D780C873166282521360BCFF242BEC" 331 + "28A02D432E0D724808F6B50281EBAC66589" 332 + "4080252D20D84A5F1140150A829BEEFE8B8" 333 + "0166B1268C26E195F09E9B5494300505720" 334 + "A658D8AA29FB8290609394B4A2AAA546114" 335 + "7229B306B660D65000394D44434A3A2EB4F" 336 + "4EE337E18ABCB25133A9D36D24565423D75" 337 + "29868CCB3317E7B8076086442C04435840E" 338 + "A88C530249313D474FE72D9E18262AA0408" 339 + "F5027C4861917054892ADE96DCB2A09C309" 340 + "E9111E08652B0FBA7A124A0ADAC93BA53D6" 341 + "0140959308BC5BFF014004237A41F7107AB" 342 + "818BF92C3CDD0CC1B63A188970CB88EE4B1" 343 + "0DD28408F3218C0D7CDCDD1481B28781AC5" 344 + "D288D5F799231D458F8438978023DE0EC22" 345 + "898BA425A248437C9B026587A6A487C33D1" 346 + "8A0B1117DB814487172D01BDEB4CBB97F0C" 347 + "885925AF38BEB8222100F3C2235DF26757E" 348 + "4FD981292B3D0333A5509515C8BA06D1C24" 349 + "42FA69DA402E608A8050398646FA04801BC" 350 + "87C8201D80185F0B3370E620484CB6BF745" 351 + "456714211909420CD41C0B50925F9D3D399" 352 + "638B9F358EEE09A38D64F92112AC4A01948" 353 + "53C8217DF0902519C36CBA9BD0C4819CECA" 354 + "430B92A0228100440CC253B7B36E0A407B1" 355 + "668C0C96E6E5A2821B302E9767E44DA3140" 356 + "F1DC3412088840EA86668E3A1862E3DE767" 357 + "682723393255A9E9BA8EF13661A753F3525" 358 + "136A05B1E34CFBA80BF4A8009B5747E54C0" 359 + "04038A0FF7115FA05DBC681D68DCC82EA69" 360 + "55CB67A24C100A04294C0C25B1005014380" 361 + "707D7C3ECE4936C492542A27A02D26BC137" 362 + "E119C29485C6F987B2C8A5B89B32540E502" 363 + "64850B5F118F0AA0C80283745108B128990" 364 + "AD15EB547B08A66623FB01C582FEB200390" 365 + "2DC3538AA80F2517EC7CB2A3A0E297296B0" 366 + "625760991AA3B6A6938C4FB6BC752326486" 367 + "C5E62A6AE1DD55B03E60029D93E3DD82080" 368 + "8664AA2E85443DDEA0BE052426"; 369 hexStringToByteArray(String s)370 public static byte[] hexStringToByteArray(String s) { 371 int len = s.length(); 372 byte[] data = new byte[len / 2]; 373 for (int i = 0; i < len; i += 2) { 374 data[i / 2] = 375 (byte) 376 ((Character.digit(s.charAt(i), 16) << 4) 377 + Character.digit(s.charAt(i + 1), 16)); 378 } 379 return data; 380 } 381 generateDefaultBloomfilter(String filePath)382 public static void generateDefaultBloomfilter(String filePath) throws IOException { 383 File outputFile = new File(filePath); 384 outputFile.createNewFile(); // if file already exists will do nothing 385 FileOutputStream fos = new FileOutputStream(filePath); 386 fos.write(hexStringToByteArray(BLOOM_FILTER_DEFAULT)); 387 fos.close(); 388 } 389 } 390