hash.go (18287B)
1 package html 2 3 // generated by hasher -type=Hash -file=hash.go; DO NOT EDIT, except for adding more constants to the list and rerun go generate 4 5 // uses github.com/tdewolff/hasher 6 //go:generate hasher -type=Hash -file=hash.go 7 8 // Hash defines perfect hashes for a predefined list of strings 9 type Hash uint32 10 11 // Unique hash definitions to be used instead of strings 12 const ( 13 A Hash = 0x1 // a 14 Abbr Hash = 0x37a04 // abbr 15 About Hash = 0x5 // about 16 Accept Hash = 0x1106 // accept 17 Accept_Charset Hash = 0x110e // accept-charset 18 Action Hash = 0x23f06 // action 19 Address Hash = 0x5a07 // address 20 Align Hash = 0x32705 // align 21 Alink Hash = 0x7005 // alink 22 Allowfullscreen Hash = 0x2ad0f // allowfullscreen 23 Amp_Boilerplate Hash = 0x610f // amp-boilerplate 24 Area Hash = 0x1e304 // area 25 Article Hash = 0x2707 // article 26 Aside Hash = 0xb405 // aside 27 Async Hash = 0xac05 // async 28 Audio Hash = 0xd105 // audio 29 Autofocus Hash = 0xe409 // autofocus 30 Autoplay Hash = 0x10808 // autoplay 31 Axis Hash = 0x11004 // axis 32 B Hash = 0x101 // b 33 Background Hash = 0x300a // background 34 Base Hash = 0x19604 // base 35 Bb Hash = 0x37b02 // bb 36 Bdi Hash = 0x7503 // bdi 37 Bdo Hash = 0x31f03 // bdo 38 Bgcolor Hash = 0x12607 // bgcolor 39 Blockquote Hash = 0x13e0a // blockquote 40 Body Hash = 0xd04 // body 41 Br Hash = 0x37c02 // br 42 Button Hash = 0x14806 // button 43 Canvas Hash = 0xb006 // canvas 44 Caption Hash = 0x21f07 // caption 45 Charset Hash = 0x1807 // charset 46 Checked Hash = 0x1b307 // checked 47 Cite Hash = 0xfb04 // cite 48 Class Hash = 0x15905 // class 49 Classid Hash = 0x15907 // classid 50 Clear Hash = 0x2b05 // clear 51 Code Hash = 0x19204 // code 52 Codebase Hash = 0x19208 // codebase 53 Codetype Hash = 0x1a408 // codetype 54 Col Hash = 0x12803 // col 55 Colgroup Hash = 0x1bb08 // colgroup 56 Color Hash = 0x12805 // color 57 Cols Hash = 0x1cf04 // cols 58 Colspan Hash = 0x1cf07 // colspan 59 Compact Hash = 0x1ec07 // compact 60 Content Hash = 0x28407 // content 61 Controls Hash = 0x20108 // controls 62 Data Hash = 0x1f04 // data 63 Datalist Hash = 0x1f08 // datalist 64 Datatype Hash = 0x4d08 // datatype 65 Dd Hash = 0x5b02 // dd 66 Declare Hash = 0xb707 // declare 67 Default Hash = 0x7f07 // default 68 DefaultChecked Hash = 0x1730e // defaultChecked 69 DefaultMuted Hash = 0x7f0c // defaultMuted 70 DefaultSelected Hash = 0x8a0f // defaultSelected 71 Defer Hash = 0x9805 // defer 72 Del Hash = 0x10503 // del 73 Details Hash = 0x15f07 // details 74 Dfn Hash = 0x16c03 // dfn 75 Dialog Hash = 0xa606 // dialog 76 Dir Hash = 0x7603 // dir 77 Disabled Hash = 0x18008 // disabled 78 Div Hash = 0x18703 // div 79 Dl Hash = 0x1b902 // dl 80 Dt Hash = 0x23102 // dt 81 Em Hash = 0x4302 // em 82 Embed Hash = 0x4905 // embed 83 Enabled Hash = 0x26c07 // enabled 84 Enctype Hash = 0x1fa07 // enctype 85 Face Hash = 0x5604 // face 86 Fieldset Hash = 0x21408 // fieldset 87 Figcaption Hash = 0x21c0a // figcaption 88 Figure Hash = 0x22606 // figure 89 Footer Hash = 0xdb06 // footer 90 For Hash = 0x23b03 // for 91 Form Hash = 0x23b04 // form 92 Formaction Hash = 0x23b0a // formaction 93 Formnovalidate Hash = 0x2450e // formnovalidate 94 Frame Hash = 0x28c05 // frame 95 Frameborder Hash = 0x28c0b // frameborder 96 H1 Hash = 0x2e002 // h1 97 H2 Hash = 0x25302 // h2 98 H3 Hash = 0x25502 // h3 99 H4 Hash = 0x25702 // h4 100 H5 Hash = 0x25902 // h5 101 H6 Hash = 0x25b02 // h6 102 Head Hash = 0x2d204 // head 103 Header Hash = 0x2d206 // header 104 Hgroup Hash = 0x25d06 // hgroup 105 Hidden Hash = 0x26806 // hidden 106 Hr Hash = 0x32d02 // hr 107 Href Hash = 0x32d04 // href 108 Hreflang Hash = 0x32d08 // hreflang 109 Html Hash = 0x27304 // html 110 Http_Equiv Hash = 0x2770a // http-equiv 111 I Hash = 0x2401 // i 112 Icon Hash = 0x28304 // icon 113 Id Hash = 0xb602 // id 114 Iframe Hash = 0x28b06 // iframe 115 Img Hash = 0x29703 // img 116 Inert Hash = 0xf605 // inert 117 Inlist Hash = 0x29a06 // inlist 118 Input Hash = 0x2a405 // input 119 Ins Hash = 0x2a903 // ins 120 Ismap Hash = 0x11205 // ismap 121 Itemscope Hash = 0xfc09 // itemscope 122 Kbd Hash = 0x7403 // kbd 123 Keygen Hash = 0x1f606 // keygen 124 Label Hash = 0xbe05 // label 125 Lang Hash = 0x33104 // lang 126 Language Hash = 0x33108 // language 127 Legend Hash = 0x2c506 // legend 128 Li Hash = 0x2302 // li 129 Link Hash = 0x7104 // link 130 Longdesc Hash = 0xc208 // longdesc 131 Main Hash = 0xf404 // main 132 Manifest Hash = 0x2bc08 // manifest 133 Map Hash = 0xee03 // map 134 Mark Hash = 0x2cb04 // mark 135 Math Hash = 0x2cf04 // math 136 Max Hash = 0x2d803 // max 137 Maxlength Hash = 0x2d809 // maxlength 138 Media Hash = 0xa405 // media 139 Menu Hash = 0x12204 // menu 140 Meta Hash = 0x2e204 // meta 141 Meter Hash = 0x2f705 // meter 142 Method Hash = 0x2fc06 // method 143 Multiple Hash = 0x30208 // multiple 144 Muted Hash = 0x30a05 // muted 145 Name Hash = 0xa204 // name 146 Nav Hash = 0x32403 // nav 147 Nohref Hash = 0x32b06 // nohref 148 Noresize Hash = 0x13608 // noresize 149 Noscript Hash = 0x14d08 // noscript 150 Noshade Hash = 0x16e07 // noshade 151 Novalidate Hash = 0x2490a // novalidate 152 Nowrap Hash = 0x1d506 // nowrap 153 Object Hash = 0xd506 // object 154 Ol Hash = 0xcb02 // ol 155 Open Hash = 0x32104 // open 156 Optgroup Hash = 0x35608 // optgroup 157 Option Hash = 0x30f06 // option 158 Output Hash = 0x206 // output 159 P Hash = 0x501 // p 160 Param Hash = 0xf005 // param 161 Pauseonexit Hash = 0x1160b // pauseonexit 162 Picture Hash = 0x1c207 // picture 163 Plaintext Hash = 0x1da09 // plaintext 164 Poster Hash = 0x26206 // poster 165 Pre Hash = 0x35d03 // pre 166 Prefix Hash = 0x35d06 // prefix 167 Profile Hash = 0x36407 // profile 168 Progress Hash = 0x34208 // progress 169 Property Hash = 0x31508 // property 170 Q Hash = 0x14301 // q 171 Rb Hash = 0x2f02 // rb 172 Readonly Hash = 0x1e408 // readonly 173 Rel Hash = 0xbc03 // rel 174 Required Hash = 0x22a08 // required 175 Resource Hash = 0x1c708 // resource 176 Rev Hash = 0x7803 // rev 177 Reversed Hash = 0x7808 // reversed 178 Rows Hash = 0x9c04 // rows 179 Rowspan Hash = 0x9c07 // rowspan 180 Rp Hash = 0x6a02 // rp 181 Rt Hash = 0x2802 // rt 182 Rtc Hash = 0xf903 // rtc 183 Ruby Hash = 0xe004 // ruby 184 Rules Hash = 0x12c05 // rules 185 S Hash = 0x1c01 // s 186 Samp Hash = 0x6004 // samp 187 Scope Hash = 0x10005 // scope 188 Scoped Hash = 0x10006 // scoped 189 Script Hash = 0x14f06 // script 190 Scrolling Hash = 0xc809 // scrolling 191 Seamless Hash = 0x19808 // seamless 192 Section Hash = 0x13007 // section 193 Select Hash = 0x16506 // select 194 Selected Hash = 0x16508 // selected 195 Shape Hash = 0x19f05 // shape 196 Size Hash = 0x13a04 // size 197 Slot Hash = 0x20804 // slot 198 Small Hash = 0x2ab05 // small 199 Sortable Hash = 0x2ef08 // sortable 200 Source Hash = 0x1c906 // source 201 Span Hash = 0x9f04 // span 202 Src Hash = 0x34903 // src 203 Srcset Hash = 0x34906 // srcset 204 Start Hash = 0x2505 // start 205 Strong Hash = 0x29e06 // strong 206 Style Hash = 0x2c205 // style 207 Sub Hash = 0x31d03 // sub 208 Summary Hash = 0x33907 // summary 209 Sup Hash = 0x34003 // sup 210 Svg Hash = 0x34f03 // svg 211 Tabindex Hash = 0x2e408 // tabindex 212 Table Hash = 0x2f205 // table 213 Target Hash = 0x706 // target 214 Tbody Hash = 0xc05 // tbody 215 Td Hash = 0x1e02 // td 216 Template Hash = 0x4208 // template 217 Text Hash = 0x1df04 // text 218 Textarea Hash = 0x1df08 // textarea 219 Tfoot Hash = 0xda05 // tfoot 220 Th Hash = 0x2d102 // th 221 Thead Hash = 0x2d105 // thead 222 Time Hash = 0x12004 // time 223 Title Hash = 0x15405 // title 224 Tr Hash = 0x1f202 // tr 225 Track Hash = 0x1f205 // track 226 Translate Hash = 0x20b09 // translate 227 Truespeed Hash = 0x23209 // truespeed 228 Type Hash = 0x5104 // type 229 Typemustmatch Hash = 0x1a80d // typemustmatch 230 Typeof Hash = 0x5106 // typeof 231 U Hash = 0x301 // u 232 Ul Hash = 0x8302 // ul 233 Undeterminate Hash = 0x370d // undeterminate 234 Usemap Hash = 0xeb06 // usemap 235 Valign Hash = 0x32606 // valign 236 Value Hash = 0x18905 // value 237 Valuetype Hash = 0x18909 // valuetype 238 Var Hash = 0x28003 // var 239 Video Hash = 0x35205 // video 240 Visible Hash = 0x36b07 // visible 241 Vlink Hash = 0x37205 // vlink 242 Vocab Hash = 0x37705 // vocab 243 Wbr Hash = 0x37e03 // wbr 244 Xmlns Hash = 0x2eb05 // xmlns 245 Xmp Hash = 0x36203 // xmp 246 ) 247 248 // String returns the hash' name. 249 func (i Hash) String() string { 250 start := uint32(i >> 8) 251 n := uint32(i & 0xff) 252 if start+n > uint32(len(_Hash_text)) { 253 return "" 254 } 255 return _Hash_text[start : start+n] 256 } 257 258 // ToHash returns the hash whose name is s. It returns zero if there is no 259 // such hash. It is case sensitive. 260 func ToHash(s []byte) Hash { 261 if len(s) == 0 || len(s) > _Hash_maxLen { 262 return 0 263 } 264 h := uint32(_Hash_hash0) 265 for i := 0; i < len(s); i++ { 266 h ^= uint32(s[i]) 267 h *= 16777619 268 } 269 if i := _Hash_table[h&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) { 270 t := _Hash_text[i>>8 : i>>8+i&0xff] 271 for i := 0; i < len(s); i++ { 272 if t[i] != s[i] { 273 goto NEXT 274 } 275 } 276 return i 277 } 278 NEXT: 279 if i := _Hash_table[(h>>16)&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) { 280 t := _Hash_text[i>>8 : i>>8+i&0xff] 281 for i := 0; i < len(s); i++ { 282 if t[i] != s[i] { 283 return 0 284 } 285 } 286 return i 287 } 288 return 0 289 } 290 291 const _Hash_hash0 = 0x9acb0442 292 const _Hash_maxLen = 15 293 const _Hash_text = "aboutputargetbodyaccept-charsetdatalistarticlearbackgroundet" + 294 "erminatemplatembedatatypeofaceaddressamp-boilerplatealinkbdi" + 295 "reversedefaultMutedefaultSelectedeferowspanamedialogasyncanv" + 296 "asideclarelabelongdescrollingaudiobjectfooterubyautofocusema" + 297 "paramainertcitemscopedelautoplayaxismapauseonexitimenubgcolo" + 298 "rulesectionoresizeblockquotebuttonoscriptitleclassidetailsel" + 299 "ectedfnoshadefaultCheckedisabledivaluetypecodebaseamlesshape" + 300 "codetypemustmatcheckedlcolgroupicturesourcecolspanowraplaint" + 301 "extareadonlycompactrackeygenctypecontrolslotranslatefieldset" + 302 "figcaptionfigurequiredtruespeedformactionformnovalidateh2h3h" + 303 "4h5h6hgrouposterhiddenabledhtmlhttp-equivaricontentiframebor" + 304 "derimginlistronginputinsmallowfullscreenmanifestylegendmarkm" + 305 "atheadermaxlength1metabindexmlnsortablemetermethodmultiplemu" + 306 "tedoptionpropertysubdopenavalignohreflanguagesummarysuprogre" + 307 "ssrcsetsvgvideoptgrouprefixmprofilevisiblevlinkvocabbrwbr" 308 309 var _Hash_table = [1 << 9]Hash{ 310 0x0: 0x1df08, // textarea 311 0x4: 0x32d02, // hr 312 0x8: 0x1c207, // picture 313 0xb: 0x18905, // value 314 0xf: 0x2e408, // tabindex 315 0x12: 0x15905, // class 316 0x15: 0x37e03, // wbr 317 0x18: 0x1a80d, // typemustmatch 318 0x1a: 0x1b902, // dl 319 0x1d: 0xf903, // rtc 320 0x1e: 0x25702, // h4 321 0x22: 0x2ef08, // sortable 322 0x24: 0x4208, // template 323 0x25: 0x28c0b, // frameborder 324 0x28: 0x37a04, // abbr 325 0x29: 0x28b06, // iframe 326 0x2a: 0x610f, // amp-boilerplate 327 0x2c: 0x1e408, // readonly 328 0x30: 0x23f06, // action 329 0x33: 0x28c05, // frame 330 0x35: 0x12c05, // rules 331 0x36: 0x30208, // multiple 332 0x38: 0x31f03, // bdo 333 0x39: 0x1d506, // nowrap 334 0x3e: 0x21408, // fieldset 335 0x3f: 0x7503, // bdi 336 0x46: 0x7f0c, // defaultMuted 337 0x49: 0x35205, // video 338 0x4c: 0x19808, // seamless 339 0x4d: 0x13608, // noresize 340 0x4f: 0xb602, // id 341 0x51: 0x25d06, // hgroup 342 0x52: 0x23102, // dt 343 0x55: 0x12805, // color 344 0x56: 0x34003, // sup 345 0x59: 0x370d, // undeterminate 346 0x5a: 0x35608, // optgroup 347 0x5b: 0x2d206, // header 348 0x5c: 0xb405, // aside 349 0x5f: 0x10005, // scope 350 0x60: 0x101, // b 351 0x61: 0xcb02, // ol 352 0x64: 0x32b06, // nohref 353 0x65: 0x1da09, // plaintext 354 0x66: 0x20804, // slot 355 0x67: 0x11004, // axis 356 0x68: 0x12803, // col 357 0x69: 0x32606, // valign 358 0x6c: 0x2d105, // thead 359 0x70: 0x34906, // srcset 360 0x71: 0x26806, // hidden 361 0x76: 0x1bb08, // colgroup 362 0x78: 0x34f03, // svg 363 0x7b: 0x2cb04, // mark 364 0x7e: 0x33104, // lang 365 0x81: 0x1cf04, // cols 366 0x86: 0x5a07, // address 367 0x8b: 0xf404, // main 368 0x8c: 0x4302, // em 369 0x8f: 0x32d08, // hreflang 370 0x93: 0x1b307, // checked 371 0x94: 0x25902, // h5 372 0x95: 0x301, // u 373 0x96: 0x32705, // align 374 0x97: 0x14301, // q 375 0x99: 0xd506, // object 376 0x9b: 0x28407, // content 377 0x9d: 0xc809, // scrolling 378 0x9f: 0x36407, // profile 379 0xa0: 0x34903, // src 380 0xa1: 0xda05, // tfoot 381 0xa3: 0x2f705, // meter 382 0xa4: 0x37705, // vocab 383 0xa6: 0xd04, // body 384 0xa8: 0x19204, // code 385 0xac: 0x20108, // controls 386 0xb0: 0x2ab05, // small 387 0xb1: 0x18008, // disabled 388 0xb5: 0x5604, // face 389 0xb6: 0x501, // p 390 0xb9: 0x2302, // li 391 0xbb: 0xe409, // autofocus 392 0xbf: 0x27304, // html 393 0xc2: 0x4d08, // datatype 394 0xc6: 0x35d06, // prefix 395 0xcb: 0x35d03, // pre 396 0xcc: 0x1106, // accept 397 0xd1: 0x23b03, // for 398 0xd5: 0x29e06, // strong 399 0xd6: 0x9c07, // rowspan 400 0xd7: 0x25502, // h3 401 0xd8: 0x2cf04, // math 402 0xde: 0x16e07, // noshade 403 0xdf: 0x19f05, // shape 404 0xe1: 0x10006, // scoped 405 0xe3: 0x706, // target 406 0xe6: 0x21c0a, // figcaption 407 0xe9: 0x1df04, // text 408 0xea: 0x1c708, // resource 409 0xec: 0xee03, // map 410 0xf0: 0x29a06, // inlist 411 0xf1: 0x16506, // select 412 0xf2: 0x1f606, // keygen 413 0xf3: 0x5106, // typeof 414 0xf6: 0xb006, // canvas 415 0xf7: 0x30f06, // option 416 0xf8: 0xbe05, // label 417 0xf9: 0xbc03, // rel 418 0xfb: 0x1f04, // data 419 0xfd: 0x6004, // samp 420 0x100: 0x110e, // accept-charset 421 0x101: 0xeb06, // usemap 422 0x103: 0x2bc08, // manifest 423 0x109: 0xa204, // name 424 0x10a: 0x14806, // button 425 0x10b: 0x2b05, // clear 426 0x10e: 0x33907, // summary 427 0x10f: 0x2e204, // meta 428 0x110: 0x33108, // language 429 0x112: 0x300a, // background 430 0x113: 0x2707, // article 431 0x116: 0x23b0a, // formaction 432 0x119: 0x1, // a 433 0x11b: 0x5, // about 434 0x11c: 0xfc09, // itemscope 435 0x11e: 0x14d08, // noscript 436 0x11f: 0x15907, // classid 437 0x120: 0x36203, // xmp 438 0x121: 0x19604, // base 439 0x123: 0x1c01, // s 440 0x124: 0x36b07, // visible 441 0x126: 0x37b02, // bb 442 0x127: 0x9c04, // rows 443 0x12d: 0x2450e, // formnovalidate 444 0x131: 0x1f205, // track 445 0x135: 0x18703, // div 446 0x136: 0xac05, // async 447 0x137: 0x31508, // property 448 0x13a: 0x16c03, // dfn 449 0x13e: 0xf605, // inert 450 0x142: 0x10503, // del 451 0x144: 0x25302, // h2 452 0x147: 0x2c205, // style 453 0x149: 0x29703, // img 454 0x14a: 0xc05, // tbody 455 0x14b: 0x7603, // dir 456 0x14c: 0x2eb05, // xmlns 457 0x14e: 0x1f08, // datalist 458 0x14f: 0x32d04, // href 459 0x150: 0x1f202, // tr 460 0x151: 0x13e0a, // blockquote 461 0x152: 0x18909, // valuetype 462 0x155: 0xdb06, // footer 463 0x157: 0x14f06, // script 464 0x158: 0x1cf07, // colspan 465 0x15d: 0x1730e, // defaultChecked 466 0x15f: 0x2490a, // novalidate 467 0x164: 0x1a408, // codetype 468 0x165: 0x2c506, // legend 469 0x16b: 0x1160b, // pauseonexit 470 0x16c: 0x21f07, // caption 471 0x16f: 0x26c07, // enabled 472 0x173: 0x26206, // poster 473 0x175: 0x30a05, // muted 474 0x176: 0x11205, // ismap 475 0x178: 0x2a903, // ins 476 0x17a: 0xe004, // ruby 477 0x17b: 0x37c02, // br 478 0x17c: 0x8a0f, // defaultSelected 479 0x17d: 0x7403, // kbd 480 0x17f: 0x1c906, // source 481 0x182: 0x9f04, // span 482 0x184: 0x2d803, // max 483 0x18a: 0x5b02, // dd 484 0x18b: 0x13a04, // size 485 0x18c: 0xa405, // media 486 0x18d: 0x19208, // codebase 487 0x18f: 0x4905, // embed 488 0x192: 0x5104, // type 489 0x193: 0xf005, // param 490 0x194: 0x25b02, // h6 491 0x197: 0x28304, // icon 492 0x198: 0x12607, // bgcolor 493 0x199: 0x2ad0f, // allowfullscreen 494 0x19a: 0x12004, // time 495 0x19b: 0x7803, // rev 496 0x19d: 0x34208, // progress 497 0x19e: 0x22606, // figure 498 0x1a0: 0x6a02, // rp 499 0x1a2: 0xa606, // dialog 500 0x1a4: 0x2802, // rt 501 0x1a7: 0x1e304, // area 502 0x1a8: 0x7808, // reversed 503 0x1aa: 0x32104, // open 504 0x1ac: 0x2d204, // head 505 0x1ad: 0x7005, // alink 506 0x1af: 0x28003, // var 507 0x1b0: 0x15f07, // details 508 0x1b1: 0x2401, // i 509 0x1b3: 0x1e02, // td 510 0x1b4: 0xb707, // declare 511 0x1b5: 0x8302, // ul 512 0x1ba: 0x2fc06, // method 513 0x1bd: 0x13007, // section 514 0x1be: 0x22a08, // required 515 0x1c2: 0x9805, // defer 516 0x1c3: 0x37205, // vlink 517 0x1c4: 0x15405, // title 518 0x1c5: 0x2770a, // http-equiv 519 0x1c6: 0x1fa07, // enctype 520 0x1c7: 0x1ec07, // compact 521 0x1c8: 0x2d809, // maxlength 522 0x1c9: 0x16508, // selected 523 0x1cc: 0xd105, // audio 524 0x1cd: 0xc208, // longdesc 525 0x1d1: 0xfb04, // cite 526 0x1da: 0x2505, // start 527 0x1de: 0x2d102, // th 528 0x1df: 0x10808, // autoplay 529 0x1e2: 0x7104, // link 530 0x1e3: 0x206, // output 531 0x1e5: 0x12204, // menu 532 0x1e6: 0x2a405, // input 533 0x1eb: 0x32403, // nav 534 0x1ec: 0x31d03, // sub 535 0x1ee: 0x1807, // charset 536 0x1ef: 0x7f07, // default 537 0x1f3: 0x2f205, // table 538 0x1f4: 0x23b04, // form 539 0x1f5: 0x23209, // truespeed 540 0x1f6: 0x2f02, // rb 541 0x1fb: 0x20b09, // translate 542 0x1fd: 0x2e002, // h1 543 }