hash.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. package svg
  2. // generated by hasher -type=Hash -file=hash.go; DO NOT EDIT, except for adding more constants to the list and rerun go generate
  3. // uses github.com/tdewolff/hasher
  4. //go:generate hasher -type=Hash -file=hash.go
  5. // Hash defines perfect hashes for a predefined list of strings
  6. type Hash uint32
  7. // Unique hash definitions to be used instead of strings
  8. const (
  9. A Hash = 0x101 // a
  10. Alignment_Baseline Hash = 0x2e12 // alignment-baseline
  11. BaseProfile Hash = 0xb // baseProfile
  12. Baseline_Shift Hash = 0x380e // baseline-shift
  13. Buffered_Rendering Hash = 0x5212 // buffered-rendering
  14. Clip Hash = 0x6404 // clip
  15. Clip_Path Hash = 0x6409 // clip-path
  16. Clip_Rule Hash = 0x8009 // clip-rule
  17. Color Hash = 0xd805 // color
  18. Color_Interpolation Hash = 0xd813 // color-interpolation
  19. Color_Interpolation_Filters Hash = 0xd81b // color-interpolation-filters
  20. Color_Profile Hash = 0x1ea0d // color-profile
  21. Color_Rendering Hash = 0x2250f // color-rendering
  22. ContentScriptType Hash = 0xa011 // contentScriptType
  23. ContentStyleType Hash = 0xb110 // contentStyleType
  24. Cursor Hash = 0xc106 // cursor
  25. D Hash = 0x5901 // d
  26. Defs Hash = 0x35c04 // defs
  27. Direction Hash = 0x2ff09 // direction
  28. Display Hash = 0x9807 // display
  29. Dominant_Baseline Hash = 0x18511 // dominant-baseline
  30. Enable_Background Hash = 0x8811 // enable-background
  31. FeImage Hash = 0x14507 // feImage
  32. Fill Hash = 0xc904 // fill
  33. Fill_Opacity Hash = 0x3300c // fill-opacity
  34. Fill_Rule Hash = 0xc909 // fill-rule
  35. Filter Hash = 0xec06 // filter
  36. Flood_Color Hash = 0xd20b // flood-color
  37. Flood_Opacity Hash = 0x1050d // flood-opacity
  38. Font Hash = 0x11404 // font
  39. Font_Family Hash = 0x1140b // font-family
  40. Font_Size Hash = 0x11f09 // font-size
  41. Font_Size_Adjust Hash = 0x11f10 // font-size-adjust
  42. Font_Stretch Hash = 0x1370c // font-stretch
  43. Font_Style Hash = 0x14c0a // font-style
  44. Font_Variant Hash = 0x1560c // font-variant
  45. Font_Weight Hash = 0x1620b // font-weight
  46. G Hash = 0x1601 // g
  47. Glyph_Orientation_Horizontal Hash = 0x1c61c // glyph-orientation-horizontal
  48. Glyph_Orientation_Vertical Hash = 0x161a // glyph-orientation-vertical
  49. Height Hash = 0x6c06 // height
  50. Href Hash = 0x14204 // href
  51. Image Hash = 0x16d05 // image
  52. Image_Rendering Hash = 0x16d0f // image-rendering
  53. Kerning Hash = 0x1af07 // kerning
  54. Letter_Spacing Hash = 0x90e // letter-spacing
  55. Lighting_Color Hash = 0x1e10e // lighting-color
  56. Line Hash = 0x3c04 // line
  57. Marker Hash = 0x17c06 // marker
  58. Marker_End Hash = 0x17c0a // marker-end
  59. Marker_Mid Hash = 0x1960a // marker-mid
  60. Marker_Start Hash = 0x1a00c // marker-start
  61. Mask Hash = 0x1ac04 // mask
  62. Metadata Hash = 0x1b608 // metadata
  63. Missing_Glyph Hash = 0x1be0d // missing-glyph
  64. Opacity Hash = 0x10b07 // opacity
  65. Overflow Hash = 0x25508 // overflow
  66. Paint_Order Hash = 0x2a10b // paint-order
  67. Path Hash = 0x6904 // path
  68. Pattern Hash = 0x1f707 // pattern
  69. Pointer_Events Hash = 0x1fe0e // pointer-events
  70. Points Hash = 0x21a06 // points
  71. Polygon Hash = 0x23407 // polygon
  72. Polyline Hash = 0x23b08 // polyline
  73. PreserveAspectRatio Hash = 0x24313 // preserveAspectRatio
  74. Rect Hash = 0x30104 // rect
  75. Rx Hash = 0x4f02 // rx
  76. Ry Hash = 0xc602 // ry
  77. Script Hash = 0xf206 // script
  78. Shape_Rendering Hash = 0x20b0f // shape-rendering
  79. Solid_Color Hash = 0x21f0b // solid-color
  80. Solid_Opacity Hash = 0x35f0d // solid-opacity
  81. Stop_Color Hash = 0x12d0a // stop-color
  82. Stop_Opacity Hash = 0x2670c // stop-opacity
  83. Stroke Hash = 0x27306 // stroke
  84. Stroke_Dasharray Hash = 0x27310 // stroke-dasharray
  85. Stroke_Dashoffset Hash = 0x28311 // stroke-dashoffset
  86. Stroke_Linecap Hash = 0x2940e // stroke-linecap
  87. Stroke_Linejoin Hash = 0x2ac0f // stroke-linejoin
  88. Stroke_Miterlimit Hash = 0x2bb11 // stroke-miterlimit
  89. Stroke_Opacity Hash = 0x2cc0e // stroke-opacity
  90. Stroke_Width Hash = 0x2da0c // stroke-width
  91. Style Hash = 0x15105 // style
  92. Svg Hash = 0x2e603 // svg
  93. Switch Hash = 0x2e906 // switch
  94. Symbol Hash = 0x2ef06 // symbol
  95. Text_Anchor Hash = 0x450b // text-anchor
  96. Text_Decoration Hash = 0x710f // text-decoration
  97. Text_Rendering Hash = 0xf70e // text-rendering
  98. Type Hash = 0x11004 // type
  99. Unicode_Bidi Hash = 0x2f50c // unicode-bidi
  100. Use Hash = 0x30803 // use
  101. Vector_Effect Hash = 0x30b0d // vector-effect
  102. Version Hash = 0x31807 // version
  103. ViewBox Hash = 0x31f07 // viewBox
  104. Viewport_Fill Hash = 0x3270d // viewport-fill
  105. Viewport_Fill_Opacity Hash = 0x32715 // viewport-fill-opacity
  106. Visibility Hash = 0x33c0a // visibility
  107. White_Space Hash = 0x25c0b // white-space
  108. Width Hash = 0x2e105 // width
  109. Word_Spacing Hash = 0x3460c // word-spacing
  110. Writing_Mode Hash = 0x3520c // writing-mode
  111. X Hash = 0x4701 // x
  112. X1 Hash = 0x5002 // x1
  113. X2 Hash = 0x32502 // x2
  114. Xml_Space Hash = 0x36c09 // xml:space
  115. Y Hash = 0x1801 // y
  116. Y1 Hash = 0x9e02 // y1
  117. Y2 Hash = 0xc702 // y2
  118. )
  119. // String returns the hash' name.
  120. func (i Hash) String() string {
  121. start := uint32(i >> 8)
  122. n := uint32(i & 0xff)
  123. if start+n > uint32(len(_Hash_text)) {
  124. return ""
  125. }
  126. return _Hash_text[start : start+n]
  127. }
  128. // ToHash returns the hash whose name is s. It returns zero if there is no
  129. // such hash. It is case sensitive.
  130. func ToHash(s []byte) Hash {
  131. if len(s) == 0 || len(s) > _Hash_maxLen {
  132. return 0
  133. }
  134. h := uint32(_Hash_hash0)
  135. for i := 0; i < len(s); i++ {
  136. h ^= uint32(s[i])
  137. h *= 16777619
  138. }
  139. if i := _Hash_table[h&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) {
  140. t := _Hash_text[i>>8 : i>>8+i&0xff]
  141. for i := 0; i < len(s); i++ {
  142. if t[i] != s[i] {
  143. goto NEXT
  144. }
  145. }
  146. return i
  147. }
  148. NEXT:
  149. if i := _Hash_table[(h>>16)&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) {
  150. t := _Hash_text[i>>8 : i>>8+i&0xff]
  151. for i := 0; i < len(s); i++ {
  152. if t[i] != s[i] {
  153. return 0
  154. }
  155. }
  156. return i
  157. }
  158. return 0
  159. }
  160. const _Hash_hash0 = 0x30372d7b
  161. const _Hash_maxLen = 28
  162. const _Hash_text = "baseProfiletter-spacinglyph-orientation-verticalignment-base" +
  163. "line-shiftext-anchorx1buffered-renderingclip-patheightext-de" +
  164. "corationclip-rulenable-backgroundisplay1contentScriptTypecon" +
  165. "tentStyleTypecursory2fill-ruleflood-color-interpolation-filt" +
  166. "erscriptext-renderingflood-opacitypefont-familyfont-size-adj" +
  167. "ustop-colorfont-stretchrefeImagefont-stylefont-variantfont-w" +
  168. "eightimage-renderingmarker-endominant-baselinemarker-midmark" +
  169. "er-startmaskerningmetadatamissing-glyph-orientation-horizont" +
  170. "alighting-color-profilepatternpointer-eventshape-renderingpo" +
  171. "intsolid-color-renderingpolygonpolylinepreserveAspectRatiove" +
  172. "rflowhite-spacestop-opacitystroke-dasharraystroke-dashoffset" +
  173. "stroke-linecapaint-orderstroke-linejoinstroke-miterlimitstro" +
  174. "ke-opacitystroke-widthsvgswitchsymbolunicode-bidirectionusev" +
  175. "ector-effectversionviewBox2viewport-fill-opacityvisibilitywo" +
  176. "rd-spacingwriting-modefsolid-opacityxml:space"
  177. var _Hash_table = [1 << 7]Hash{
  178. 0x0: 0x2940e, // stroke-linecap
  179. 0x1: 0x1140b, // font-family
  180. 0x2: 0x23b08, // polyline
  181. 0x3: 0x1f707, // pattern
  182. 0x4: 0x30104, // rect
  183. 0x5: 0x5212, // buffered-rendering
  184. 0x7: 0x2f50c, // unicode-bidi
  185. 0x8: 0x450b, // text-anchor
  186. 0x9: 0x2bb11, // stroke-miterlimit
  187. 0xa: 0xc909, // fill-rule
  188. 0xb: 0x27310, // stroke-dasharray
  189. 0xc: 0xc904, // fill
  190. 0xd: 0x1af07, // kerning
  191. 0xe: 0x2670c, // stop-opacity
  192. 0x10: 0x1a00c, // marker-start
  193. 0x11: 0x380e, // baseline-shift
  194. 0x14: 0x17c0a, // marker-end
  195. 0x15: 0x18511, // dominant-baseline
  196. 0x16: 0xc602, // ry
  197. 0x17: 0x161a, // glyph-orientation-vertical
  198. 0x18: 0x5002, // x1
  199. 0x19: 0x20b0f, // shape-rendering
  200. 0x1a: 0x32502, // x2
  201. 0x1b: 0x11f10, // font-size-adjust
  202. 0x1c: 0x2250f, // color-rendering
  203. 0x1d: 0x28311, // stroke-dashoffset
  204. 0x1f: 0x3520c, // writing-mode
  205. 0x20: 0x2e906, // switch
  206. 0x21: 0xf70e, // text-rendering
  207. 0x22: 0x23407, // polygon
  208. 0x23: 0x3460c, // word-spacing
  209. 0x24: 0x21f0b, // solid-color
  210. 0x25: 0xec06, // filter
  211. 0x26: 0x1801, // y
  212. 0x27: 0x1be0d, // missing-glyph
  213. 0x29: 0x11404, // font
  214. 0x2a: 0x4f02, // rx
  215. 0x2b: 0x9807, // display
  216. 0x2c: 0x2e603, // svg
  217. 0x2d: 0x1050d, // flood-opacity
  218. 0x2f: 0x14204, // href
  219. 0x30: 0x6404, // clip
  220. 0x31: 0x3c04, // line
  221. 0x32: 0x1620b, // font-weight
  222. 0x33: 0x1c61c, // glyph-orientation-horizontal
  223. 0x34: 0x6c06, // height
  224. 0x35: 0x9e02, // y1
  225. 0x36: 0x6904, // path
  226. 0x37: 0x31807, // version
  227. 0x38: 0x2ac0f, // stroke-linejoin
  228. 0x39: 0x4701, // x
  229. 0x3a: 0x30803, // use
  230. 0x3b: 0x2cc0e, // stroke-opacity
  231. 0x3c: 0x15105, // style
  232. 0x3d: 0x30b0d, // vector-effect
  233. 0x3e: 0x14c0a, // font-style
  234. 0x40: 0x16d05, // image
  235. 0x41: 0x1e10e, // lighting-color
  236. 0x42: 0xd813, // color-interpolation
  237. 0x43: 0x27306, // stroke
  238. 0x44: 0x2ef06, // symbol
  239. 0x47: 0x8811, // enable-background
  240. 0x48: 0x33c0a, // visibility
  241. 0x49: 0x25508, // overflow
  242. 0x4b: 0x31f07, // viewBox
  243. 0x4c: 0x2e12, // alignment-baseline
  244. 0x4d: 0x5901, // d
  245. 0x4e: 0x1560c, // font-variant
  246. 0x4f: 0x1ac04, // mask
  247. 0x50: 0x21a06, // points
  248. 0x51: 0x1b608, // metadata
  249. 0x52: 0x710f, // text-decoration
  250. 0x53: 0xd81b, // color-interpolation-filters
  251. 0x54: 0x2ff09, // direction
  252. 0x55: 0x6409, // clip-path
  253. 0x56: 0x2da0c, // stroke-width
  254. 0x59: 0x35f0d, // solid-opacity
  255. 0x5a: 0xd805, // color
  256. 0x5b: 0xd20b, // flood-color
  257. 0x5c: 0x1601, // g
  258. 0x5d: 0x2e105, // width
  259. 0x5e: 0x1ea0d, // color-profile
  260. 0x61: 0x35c04, // defs
  261. 0x62: 0x1370c, // font-stretch
  262. 0x63: 0x11004, // type
  263. 0x64: 0x8009, // clip-rule
  264. 0x66: 0x24313, // preserveAspectRatio
  265. 0x67: 0x14507, // feImage
  266. 0x68: 0x36c09, // xml:space
  267. 0x69: 0xc106, // cursor
  268. 0x6a: 0x16d0f, // image-rendering
  269. 0x6b: 0x90e, // letter-spacing
  270. 0x6c: 0xf206, // script
  271. 0x6d: 0x12d0a, // stop-color
  272. 0x6e: 0x101, // a
  273. 0x70: 0x10b07, // opacity
  274. 0x71: 0xb110, // contentStyleType
  275. 0x72: 0x1fe0e, // pointer-events
  276. 0x73: 0xb, // baseProfile
  277. 0x74: 0x11f09, // font-size
  278. 0x75: 0x3270d, // viewport-fill
  279. 0x76: 0x3300c, // fill-opacity
  280. 0x77: 0x25c0b, // white-space
  281. 0x79: 0x17c06, // marker
  282. 0x7b: 0x2a10b, // paint-order
  283. 0x7c: 0xc702, // y2
  284. 0x7d: 0x32715, // viewport-fill-opacity
  285. 0x7e: 0x1960a, // marker-mid
  286. 0x7f: 0xa011, // contentScriptType
  287. }