mirror of
https://github.com/Luzifer/badge-gen.git
synced 2024-11-14 16:12:43 +00:00
285 lines
11 KiB
Go
285 lines
11 KiB
Go
package svg
|
|
|
|
// generated by hasher -type=Hash -file=hash.go; DO NOT EDIT, except for adding more constants to the list and rerun go generate
|
|
|
|
// uses github.com/tdewolff/hasher
|
|
//go:generate hasher -type=Hash -file=hash.go
|
|
|
|
// Hash defines perfect hashes for a predefined list of strings
|
|
type Hash uint32
|
|
|
|
// Unique hash definitions to be used instead of strings
|
|
const (
|
|
A Hash = 0x101 // a
|
|
Alignment_Baseline Hash = 0x2e12 // alignment-baseline
|
|
BaseProfile Hash = 0xb // baseProfile
|
|
Baseline_Shift Hash = 0x380e // baseline-shift
|
|
Buffered_Rendering Hash = 0x5212 // buffered-rendering
|
|
Clip Hash = 0x6404 // clip
|
|
Clip_Path Hash = 0x6409 // clip-path
|
|
Clip_Rule Hash = 0x8009 // clip-rule
|
|
Color Hash = 0xd805 // color
|
|
Color_Interpolation Hash = 0xd813 // color-interpolation
|
|
Color_Interpolation_Filters Hash = 0xd81b // color-interpolation-filters
|
|
Color_Profile Hash = 0x1ea0d // color-profile
|
|
Color_Rendering Hash = 0x2110f // color-rendering
|
|
ContentScriptType Hash = 0xa011 // contentScriptType
|
|
ContentStyleType Hash = 0xb110 // contentStyleType
|
|
Cursor Hash = 0xc106 // cursor
|
|
D Hash = 0x5901 // d
|
|
Defs Hash = 0x34b04 // defs
|
|
Direction Hash = 0x2f109 // direction
|
|
Display Hash = 0x9807 // display
|
|
Dominant_Baseline Hash = 0x18511 // dominant-baseline
|
|
Enable_Background Hash = 0x8811 // enable-background
|
|
Fill Hash = 0xc904 // fill
|
|
Fill_Opacity Hash = 0x31f0c // fill-opacity
|
|
Fill_Rule Hash = 0xc909 // fill-rule
|
|
Filter Hash = 0xec06 // filter
|
|
Flood_Color Hash = 0xd20b // flood-color
|
|
Flood_Opacity Hash = 0x1010d // flood-opacity
|
|
Font Hash = 0x11004 // font
|
|
Font_Family Hash = 0x1100b // font-family
|
|
Font_Size Hash = 0x11b09 // font-size
|
|
Font_Size_Adjust Hash = 0x11b10 // font-size-adjust
|
|
Font_Stretch Hash = 0x1330c // font-stretch
|
|
Font_Style Hash = 0x13f0a // font-style
|
|
Font_Variant Hash = 0x1490c // font-variant
|
|
Font_Weight Hash = 0x1620b // font-weight
|
|
G Hash = 0x1601 // g
|
|
Glyph_Orientation_Horizontal Hash = 0x1c61c // glyph-orientation-horizontal
|
|
Glyph_Orientation_Vertical Hash = 0x161a // glyph-orientation-vertical
|
|
Height Hash = 0x6c06 // height
|
|
Image_Rendering Hash = 0x16d0f // image-rendering
|
|
Kerning Hash = 0x1af07 // kerning
|
|
Letter_Spacing Hash = 0x90e // letter-spacing
|
|
Lighting_Color Hash = 0x1e10e // lighting-color
|
|
Line Hash = 0x3c04 // line
|
|
Marker Hash = 0x17c06 // marker
|
|
Marker_End Hash = 0x17c0a // marker-end
|
|
Marker_Mid Hash = 0x1960a // marker-mid
|
|
Marker_Start Hash = 0x1a00c // marker-start
|
|
Mask Hash = 0x1ac04 // mask
|
|
Metadata Hash = 0x1b608 // metadata
|
|
Missing_Glyph Hash = 0x1be0d // missing-glyph
|
|
Opacity Hash = 0x10707 // opacity
|
|
Overflow Hash = 0x25308 // overflow
|
|
Paint_Order Hash = 0x2930b // paint-order
|
|
Path Hash = 0x6904 // path
|
|
Pattern Hash = 0x1f707 // pattern
|
|
Pointer_Events Hash = 0x1fe0e // pointer-events
|
|
Points Hash = 0x22006 // points
|
|
Polygon Hash = 0x23207 // polygon
|
|
Polyline Hash = 0x23908 // polyline
|
|
PreserveAspectRatio Hash = 0x24113 // preserveAspectRatio
|
|
Rect Hash = 0x2f304 // rect
|
|
Rx Hash = 0x4f02 // rx
|
|
Ry Hash = 0xc602 // ry
|
|
Shape_Rendering Hash = 0xf20f // shape-rendering
|
|
Solid_Color Hash = 0x20b0b // solid-color
|
|
Solid_Opacity Hash = 0x2250d // solid-opacity
|
|
Stop_Color Hash = 0x1290a // stop-color
|
|
Stop_Opacity Hash = 0x34e0c // stop-opacity
|
|
Stroke Hash = 0x26506 // stroke
|
|
Stroke_Dasharray Hash = 0x26510 // stroke-dasharray
|
|
Stroke_Dashoffset Hash = 0x27511 // stroke-dashoffset
|
|
Stroke_Linecap Hash = 0x2860e // stroke-linecap
|
|
Stroke_Linejoin Hash = 0x29e0f // stroke-linejoin
|
|
Stroke_Miterlimit Hash = 0x2ad11 // stroke-miterlimit
|
|
Stroke_Opacity Hash = 0x2be0e // stroke-opacity
|
|
Stroke_Width Hash = 0x2cc0c // stroke-width
|
|
Style Hash = 0x14405 // style
|
|
Svg Hash = 0x2d803 // svg
|
|
Switch Hash = 0x2db06 // switch
|
|
Symbol Hash = 0x2e106 // symbol
|
|
Text_Anchor Hash = 0x450b // text-anchor
|
|
Text_Decoration Hash = 0x710f // text-decoration
|
|
Text_Rendering Hash = 0x1540e // text-rendering
|
|
Type Hash = 0x10c04 // type
|
|
Unicode_Bidi Hash = 0x2e70c // unicode-bidi
|
|
Vector_Effect Hash = 0x2fa0d // vector-effect
|
|
Version Hash = 0x30707 // version
|
|
ViewBox Hash = 0x30e07 // viewBox
|
|
Viewport_Fill Hash = 0x3160d // viewport-fill
|
|
Viewport_Fill_Opacity Hash = 0x31615 // viewport-fill-opacity
|
|
Visibility Hash = 0x32b0a // visibility
|
|
White_Space Hash = 0x25a0b // white-space
|
|
Width Hash = 0x2d305 // width
|
|
Word_Spacing Hash = 0x3350c // word-spacing
|
|
Writing_Mode Hash = 0x3410c // writing-mode
|
|
X Hash = 0x4701 // x
|
|
X1 Hash = 0x5002 // x1
|
|
X2 Hash = 0x31402 // x2
|
|
Xml_Space Hash = 0x35a09 // xml:space
|
|
Y Hash = 0x1801 // y
|
|
Y1 Hash = 0x9e02 // y1
|
|
Y2 Hash = 0xc702 // y2
|
|
)
|
|
|
|
// String returns the hash' name.
|
|
func (i Hash) String() string {
|
|
start := uint32(i >> 8)
|
|
n := uint32(i & 0xff)
|
|
if start+n > uint32(len(_Hash_text)) {
|
|
return ""
|
|
}
|
|
return _Hash_text[start : start+n]
|
|
}
|
|
|
|
// ToHash returns the hash whose name is s. It returns zero if there is no
|
|
// such hash. It is case sensitive.
|
|
func ToHash(s []byte) Hash {
|
|
if len(s) == 0 || len(s) > _Hash_maxLen {
|
|
return 0
|
|
}
|
|
h := uint32(_Hash_hash0)
|
|
for i := 0; i < len(s); i++ {
|
|
h ^= uint32(s[i])
|
|
h *= 16777619
|
|
}
|
|
if i := _Hash_table[h&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) {
|
|
t := _Hash_text[i>>8 : i>>8+i&0xff]
|
|
for i := 0; i < len(s); i++ {
|
|
if t[i] != s[i] {
|
|
goto NEXT
|
|
}
|
|
}
|
|
return i
|
|
}
|
|
NEXT:
|
|
if i := _Hash_table[(h>>16)&uint32(len(_Hash_table)-1)]; int(i&0xff) == len(s) {
|
|
t := _Hash_text[i>>8 : i>>8+i&0xff]
|
|
for i := 0; i < len(s); i++ {
|
|
if t[i] != s[i] {
|
|
return 0
|
|
}
|
|
}
|
|
return i
|
|
}
|
|
return 0
|
|
}
|
|
|
|
const _Hash_hash0 = 0xf7ffa4d4
|
|
const _Hash_maxLen = 28
|
|
const _Hash_text = "baseProfiletter-spacinglyph-orientation-verticalignment-base" +
|
|
"line-shiftext-anchorx1buffered-renderingclip-patheightext-de" +
|
|
"corationclip-rulenable-backgroundisplay1contentScriptTypecon" +
|
|
"tentStyleTypecursory2fill-ruleflood-color-interpolation-filt" +
|
|
"ershape-renderingflood-opacitypefont-familyfont-size-adjusto" +
|
|
"p-colorfont-stretchfont-stylefont-variantext-renderingfont-w" +
|
|
"eightimage-renderingmarker-endominant-baselinemarker-midmark" +
|
|
"er-startmaskerningmetadatamissing-glyph-orientation-horizont" +
|
|
"alighting-color-profilepatternpointer-eventsolid-color-rende" +
|
|
"ringpointsolid-opacitypolygonpolylinepreserveAspectRatioverf" +
|
|
"lowhite-spacestroke-dasharraystroke-dashoffsetstroke-linecap" +
|
|
"aint-orderstroke-linejoinstroke-miterlimitstroke-opacitystro" +
|
|
"ke-widthsvgswitchsymbolunicode-bidirectionvector-effectversi" +
|
|
"onviewBox2viewport-fill-opacityvisibilityword-spacingwriting" +
|
|
"-modefstop-opacityxml:space"
|
|
|
|
var _Hash_table = [1 << 7]Hash{
|
|
0x0: 0x18511, // dominant-baseline
|
|
0x1: 0x1b608, // metadata
|
|
0x2: 0x11b10, // font-size-adjust
|
|
0x3: 0x11004, // font
|
|
0x4: 0x2d305, // width
|
|
0x5: 0x34b04, // defs
|
|
0x6: 0x450b, // text-anchor
|
|
0x7: 0x2fa0d, // vector-effect
|
|
0x8: 0x6904, // path
|
|
0x9: 0x13f0a, // font-style
|
|
0xa: 0x2d803, // svg
|
|
0xb: 0x2ad11, // stroke-miterlimit
|
|
0xc: 0x1c61c, // glyph-orientation-horizontal
|
|
0xd: 0x17c06, // marker
|
|
0xe: 0xa011, // contentScriptType
|
|
0xf: 0x1490c, // font-variant
|
|
0x10: 0x2e106, // symbol
|
|
0x11: 0x1fe0e, // pointer-events
|
|
0x12: 0x9e02, // y1
|
|
0x13: 0x1be0d, // missing-glyph
|
|
0x14: 0x1010d, // flood-opacity
|
|
0x16: 0x3410c, // writing-mode
|
|
0x18: 0x3350c, // word-spacing
|
|
0x1b: 0xc106, // cursor
|
|
0x1d: 0x4f02, // rx
|
|
0x1e: 0x34e0c, // stop-opacity
|
|
0x21: 0xec06, // filter
|
|
0x22: 0x2f304, // rect
|
|
0x25: 0x2e70c, // unicode-bidi
|
|
0x26: 0x8811, // enable-background
|
|
0x27: 0x6c06, // height
|
|
0x28: 0x26510, // stroke-dasharray
|
|
0x2a: 0xd805, // color
|
|
0x2c: 0x31402, // x2
|
|
0x2e: 0x17c0a, // marker-end
|
|
0x2f: 0x5002, // x1
|
|
0x30: 0x23908, // polyline
|
|
0x31: 0xc602, // ry
|
|
0x32: 0x25308, // overflow
|
|
0x33: 0x1ac04, // mask
|
|
0x34: 0x3160d, // viewport-fill
|
|
0x35: 0x31f0c, // fill-opacity
|
|
0x36: 0x5212, // buffered-rendering
|
|
0x38: 0xd81b, // color-interpolation-filters
|
|
0x39: 0x1540e, // text-rendering
|
|
0x3a: 0x23207, // polygon
|
|
0x3b: 0x710f, // text-decoration
|
|
0x3c: 0x10c04, // type
|
|
0x3d: 0x11b09, // font-size
|
|
0x3e: 0x1a00c, // marker-start
|
|
0x3f: 0x1ea0d, // color-profile
|
|
0x40: 0x22006, // points
|
|
0x41: 0x1330c, // font-stretch
|
|
0x42: 0x1290a, // stop-color
|
|
0x43: 0x9807, // display
|
|
0x44: 0x4701, // x
|
|
0x45: 0x20b0b, // solid-color
|
|
0x46: 0x3c04, // line
|
|
0x47: 0x6409, // clip-path
|
|
0x48: 0x30707, // version
|
|
0x49: 0x1601, // g
|
|
0x4b: 0x8009, // clip-rule
|
|
0x4d: 0x2db06, // switch
|
|
0x4f: 0x10707, // opacity
|
|
0x50: 0xd813, // color-interpolation
|
|
0x51: 0x2cc0c, // stroke-width
|
|
0x52: 0x6404, // clip
|
|
0x53: 0x2110f, // color-rendering
|
|
0x54: 0x26506, // stroke
|
|
0x55: 0x2f109, // direction
|
|
0x56: 0x1e10e, // lighting-color
|
|
0x57: 0x1801, // y
|
|
0x59: 0x14405, // style
|
|
0x5a: 0x380e, // baseline-shift
|
|
0x5c: 0xc904, // fill
|
|
0x5d: 0xf20f, // shape-rendering
|
|
0x5f: 0x2860e, // stroke-linecap
|
|
0x60: 0x27511, // stroke-dashoffset
|
|
0x61: 0x2930b, // paint-order
|
|
0x63: 0x2250d, // solid-opacity
|
|
0x64: 0x2e12, // alignment-baseline
|
|
0x65: 0x25a0b, // white-space
|
|
0x66: 0x1f707, // pattern
|
|
0x67: 0x2be0e, // stroke-opacity
|
|
0x68: 0x32b0a, // visibility
|
|
0x6a: 0x30e07, // viewBox
|
|
0x6b: 0x90e, // letter-spacing
|
|
0x6c: 0x1100b, // font-family
|
|
0x6d: 0xb110, // contentStyleType
|
|
0x6f: 0x101, // a
|
|
0x70: 0x5901, // d
|
|
0x71: 0x29e0f, // stroke-linejoin
|
|
0x72: 0x31615, // viewport-fill-opacity
|
|
0x73: 0xb, // baseProfile
|
|
0x74: 0x16d0f, // image-rendering
|
|
0x75: 0x24113, // preserveAspectRatio
|
|
0x76: 0xd20b, // flood-color
|
|
0x77: 0x1960a, // marker-mid
|
|
0x78: 0x1af07, // kerning
|
|
0x7a: 0x1620b, // font-weight
|
|
0x7b: 0x161a, // glyph-orientation-vertical
|
|
0x7d: 0x35a09, // xml:space
|
|
0x7e: 0xc909, // fill-rule
|
|
0x7f: 0xc702, // y2
|
|
}
|