github.com/hahmadia/mattermost-server@v5.11.1+incompatible/utils/textgeneration.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See License.txt for license information.
     3  
     4  package utils
     5  
     6  import (
     7  	"math/rand"
     8  	"strings"
     9  )
    10  
    11  const (
    12  	ALPHANUMERIC = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
    13  	LOWERCASE    = "abcdefghijklmnopqrstuvwxyz"
    14  )
    15  
    16  // Strings that should pass as acceptable posts
    17  var FUZZY_STRINGS_POSTS = []string{
    18  	`**[1] - [Markdown Tests]**
    19  _italics_
    20  more _italics_
    21  **bold**
    22  more **bold**
    23  **_bold-italic_**
    24  more **_bold-italic_*8
    25  ~~strikethrough~~
    26  more ~~strikethrough~~
    27  ` + "```" + `
    28  multi-line code block<enter here>
    29  multi-line code block
    30  emoji that should not render in code block: :ice_cream:
    31  ` + "```" + `
    32  ` + "`monospace`" + `
    33  [Link to Mattermost](www.mattermost.com)
    34  Inline Image with link, alt text, and hover text: ![Build Status](https://travis-ci.org/mattermost/mattermost-server.svg?branch=master)](https://travis-ci.org/mattermost/mattermost-server)
    35  
    36  Three types of lines:
    37  ***
    38  ___
    39  ---
    40  `,
    41  
    42  	` **[2] - **[More Markdown Tests]**
    43  > i am a blockquote!
    44  
    45  > i am a 2nd multiline 
    46  > quote.
    47  i am text right after a multiline quote, but not in the quote
    48  
    49  * list item
    50  * another list item
    51    * indented list item
    52  
    53  1. numbered list, item number 1
    54  2. item number two
    55  
    56  `,
    57  
    58  	` **[3]** - **[More Markdown Tests]**
    59  
    60  Table
    61  
    62  | Left-Aligned  | Center Aligned  | Right Aligned |
    63  | :------------ |:---------------:| -----:|
    64  | Left column 1 | this text       |  $100 |
    65  | Left column 2 | is              |   $10 |
    66  | Left column 3 | centered        |    $1 |
    67  
    68  Ugly table
    69  
    70  Markdown | Less | Pretty
    71  --- | --- | ---
    72  *Still* | ~~renders~~ | **nicely**
    73  1 | 2 | 3
    74  
    75  # Large heading
    76  ## Smaller heading
    77  ### Even smaller heading
    78  # Large heading
    79  ## Smaller heading
    80  ### Even smaller heading
    81  
    82  `,
    83  
    84  	` **[4]** - **[More Markdown Tests]**
    85  # This is a heading
    86  
    87  I am a multiline
    88  text.
    89  
    90  #### I am a level four heading
    91  
    92  ` + "```tex" + `
    93  f(x) = \int_{-\infty}^\infty
    94      \hat f(\xi)\,e^{2 \pi i \xi x}
    95      \,d\xi
    96  ` + "```" + `
    97  * This was some tex code*
    98  `,
    99  
   100  	`**[5]** - **[Markdown and automatic preview of content test]**
   101  
   102  ## This should display a preview for the given vine url
   103  
   104  Some text *before* the link
   105  And a smiley :)
   106  https://vine.co/v/eDeVgbFrt9L
   107  
   108  Some more text here
   109  and here
   110  and even more here
   111  `,
   112  
   113  	`**[6]** - **[More markdown and automatic preview of content test]**
   114  
   115  ## Only the first given url should render an "attachment"
   116  
   117  Lets also add a table here, because why not
   118  | Left-Aligned  | Center Aligned  | Right Aligned |
   119  | :------------ |:---------------:| -----:|
   120  | Left column 1 | this text       |  $100 |
   121  | Left column 2 | is              |   $10 |
   122  | Left column 3 | centered        |    $1 |
   123  
   124  Wiki should render:
   125  http://en.wikipedia.org/wiki/Foo
   126  https://vine.co/v/eDeVgbFrt9L
   127  `,
   128  
   129  	`**[7] [Image Test]**
   130  
   131  ## this *should* display an image
   132  
   133  http://37.media.tumblr.com/tumblr_mavsumGGAd1qboaw8o1_500.jpg
   134  `,
   135  
   136  	/*	`**[2] [Username Linking Test]**
   137  		I saw @alice--and I said "Hi @alice!" then "What's up @alice?" and then @alice, was totally @alice; she just "@alice"'d me and walked on by. That's @alice...
   138  		@alice‽‽
   139  		`,
   140  
   141  			`**[3] [Mention Highlighting Test]**
   142  		`,*/
   143  
   144  	`**[8] [Emoji Display Test 1]**
   145  :+1: :-1: :100: :1234: :8ball: :a: :ab: :abc: :abcd: :accept: 
   146  :aerial_tramway: :airplane: :alarm_clock: :ambulance: :anchor: :angel: :anger: :angry: :anguished: :ant: 
   147  :apple: :aquarius: :aries: :arrow_backward: :arrow_double_down: :arrow_double_up: :arrow_down: :arrow_down_small: :arrow_forward: :arrow_heading_down:
   148  :arrow_heading_up: :arrow_left: :arrow_lower_left: :arrow_lower_right: :arrow_right: :arrow_right_hook: :arrow_up: :arrow_up_down:
   149  :arrow_upper_left: :arrow_upper_right: :arrows_clockwise: :arrows_counterclockwise: :art: :articulated_lorry: :astonished: :atm:  :arrow_up_small: :b:
   150  :baby: :baby_bottle: :baby_chick: :baby_symbol: :back: :baggage_claim: :balloon: :ballot_box_with_check: :bamboo: :banana:
   151  :bangbang: :bank: :bar_chart: :barber: :baseball: :basketball: :bath: :bathtub: :battery: :bear:
   152  :bee: :beer: :beers: :beetle: :beginner: :bell: :bento: :bicyclist: :bike: :bikini: 
   153  :bird: :birthday: :black_circle: :black_joker: :black_medium_small_square: :black_medium_square: :black_nib: :black_small_square: :black_square: :black_square_button:
   154  :blossom: :blowfish: :blue_book: :blue_car: :blue_heart: :blush: :boar: :boat: :bomb: :book:
   155  :bookmark: :bookmark_tabs: :books: :boom: :boot: :bouquet: :bow: :bowling: :bowtie: :boy:
   156  :bread: :bride_with_veil: :bridge_at_night: :briefcase: :broken_heart: :bug: :bulb: :bullettrain_front: :bullettrain_side: :bus: 
   157  :busstop: :bust_in_silhouette: :busts_in_silhouette: :cactus: :cake: :calendar: :calling: :camel: :camera: :cancer: 
   158  :candy: :capital_abcd: :capricorn: :car: :card_index: :carousel_horse: :cat: :cat2: :cd: :chart: 
   159  :chart_with_downwards_trend: :chart_with_upwards_trend: :checkered_flag: :cherries: :cherry_blossom: :chestnut: :chicken: :children_crossing: :chocolate_bar: :christmas_tree:
   160  :church: :cinema: :circus_tent: :city_sunrise: :city_sunset: :cl: :clap: :clapper: :clipboard: :clock1: 
   161  :clock10: :clock1030: :clock11: :clock1130: :clock12: :clock1230: :clock130: :clock2: :clock230: :clock3: 
   162  :clock330: :clock4: :clock430: :clock5: :clock530: :clock6: :clock630: :clock7: :clock730: :clock8: 
   163  :clock830: :clock9: :clock930: :closed_book: :closed_lock_with_key: :closed_umbrella: :cloud: :clubs: :cn: :cocktail:
   164  :coffee: :cold_sweat: :collision: :computer: :confetti_ball: :confounded: :confused: :congratulations: :construction: :construction_worker:
   165  :convenience_store: :cookie: :cool: :cop: :copyright: :corn: :couple: :couple_with_heart: :couplekiss: :cow:
   166  :cow2: :credit_card: :crescent_moon: :crocodile: :crossed_flags: :crown: :cry: :crying_cat_face: :crystal_ball: :cupid: 
   167  :curly_loop: :currency_exchange: :curry: :custard: :customs: :cyclone: :dancer: :dancers: :dango: :dart:
   168  :dash: :date: :de: :deciduous_tree: :department_store: :diamond_shape_with_a_dot_inside: :diamonds: :disappointed: :disappointed_relieved: :dizzy:
   169  :dizzy_face: :do_not_litter: :dog: :dog2: :dollar: :dolls: :dolphin: :donut: :door: :doughnut:
   170  :dragon: :dragon_face: :dress: :dromedary_camel: :droplet: :dvd: :e-mail: :ear: :ear_of_rice: :earth_africa: 
   171  :earth_americas: :earth_asia: :egg: :eggplant: :eight: :eight_pointed_black_star: :eight_spoked_asterisk: :electric_plug: :elephant: :email: 
   172   :end: :envelope: :es: :euro: :european_castle: :european_post_office: :evergreen_tree: :exclamation: :expressionless: :eyeglasses: 
   173  :eyes: :facepunch: :factory: :fallen_leaf: :family: :fast_forward: :fax: :fearful: :feelsgood: :feet: 
   174  :ferris_wheel: :file_folder: :finnadie: :fire: :fire_engine: :fireworks: :first_quarter_moon: :first_quarter_moon_with_face: :fish: :fish_cake:
   175  :fishing_pole_and_fish: :fist: :five: :flags: :flashlight: :floppy_disk: :flower_playing_cards: :flushed: :foggy: :football:
   176  :fork_and_knife: :fountain: :four: :four_leaf_clover: :fr: :free: :fried_shrimp: :fries: :frog: :frowning:
   177  :fu: :fuelpump: :full_moon: :full_moon_with_face: :game_die: :gb: :gem: :gemini: :ghost: :gift:`,
   178  
   179  	`**[9] [Emoji Display Test 2]**
   180  :gift_heart: :girl: :globe_with_meridians: :goat: :goberserk: :godmode: :golf: :grapes: :green_apple: :green_book:
   181  :green_heart: :grey_exclamation: :grey_question: :grimacing: :grin: :grinning: :guardsman: :guitar: :gun: :haircut: 
   182  :hamburger: :hammer: :hamster: :hand: :handbag: :hankey: :hash: :hatched_chick: :hatching_chick: :headphones:
   183  :hear_no_evil: :heart: :heart_decoration: :heart_eyes: :heart_eyes_cat: :heartbeat: :heartpulse: :hearts: :heavy_check_mark: :heavy_division_sign:
   184  :heavy_dollar_sign: :heavy_exclamation_mark: :heavy_minus_sign: :heavy_multiplication_x: :heavy_plus_sign: :helicopter: :herb: :hibiscus: :high_brightness: :high_heel:
   185  :hocho: :honey_pot: :honeybee: :horse: :horse_racing: :hospital: :hotel: :hotsprings: :hourglass: :hourglass_flowing_sand:
   186  :house: :house_with_garden: :hurtrealbad: :hushed: :ice_cream: :icecream: :id: :ideograph_advantage: :imp: :inbox_tray: 
   187  :incoming_envelope: :information_desk_person: :information_source: :innocent: :interrobang: :iphone: :it: :izakaya_lantern: :jack_o_lantern:
   188  :japan: :japanese_castle: :japanese_goblin: :japanese_ogre: :jeans: :joy: :joy_cat: :jp: :key: :keycap_ten:
   189  :kimono: :kiss: :kissing: :kissing_cat: :kissing_closed_eyes: :kissing_face: :kissing_heart: :kissing_smiling_eyes: :koala: :koko:
   190  :kr: :large_blue_circle: :large_blue_diamond: :large_orange_diamond: :last_quarter_moon: :last_quarter_moon_with_face: :laughing: :leaves: :ledger: :left_luggage:
   191  :left_right_arrow: :leftwards_arrow_with_hook: :lemon: :leo: :leopard: :libra: :light_rail: :link: :lips: :lipstick:
   192  :lock: :lock_with_ink_pen: :lollipop: :loop: :loudspeaker: :love_hotel: :love_letter: :low_brightness: :m: :mag:
   193  :mag_right: :mahjong: :mailbox: :mailbox_closed: :mailbox_with_mail: :mailbox_with_no_mail: :man: :man_with_gua_pi_mao: :man_with_turban: :mans_shoe:
   194  :maple_leaf: :mask: :massage: :meat_on_bone: :mega: :melon: :memo: :mens: :metal: :metro:
   195  :microphone: :microscope: :milky_way: :minibus: :minidisc: :mobile_phone_off: :money_with_wings: :moneybag: :monkey: :monkey_face: 
   196  :monorail: :mortar_board: :mount_fuji: :mountain_bicyclist: :mountain_cableway: :mountain_railway: :mouse: :mouse2: :movie_camera: :moyai:
   197  :muscle: :mushroom: :musical_keyboard: :musical_note: :musical_score: :mute: :nail_care: :name_badge: :neckbeard: :necktie:
   198  :negative_squared_cross_mark: :neutral_face: :new: :new_moon: :new_moon_with_face: :newspaper: :ng: :nine: :no_bell:
   199  :no_bicycles: :no_entry: :no_entry_sign: :no_good: :no_mobile_phones: :no_mouth: :no_pedestrians: :no_smoking: :non-potable_water: :nose:
   200  :notebook: :notebook_with_decorative_cover: :notes: :nut_and_bolt: :o: :o2: :ocean: :octocat: :octopus: :oden: 
   201  :office: :ok: :ok_hand: :ok_woman: :older_man: :older_woman: :on: :oncoming_automobile: :oncoming_bus: :oncoming_police_car:
   202  :oncoming_taxi: :one: :open_file_folder: :open_hands: :open_mouth: :ophiuchus: :orange_book: :outbox_tray: :ox: :package:
   203  :page_facing_up: :page_with_curl: :pager: :palm_tree: :panda_face: :paperclip: :parking: :part_alternation_mark: :partly_sunny: :passport_control:
   204  :paw_prints: :peach: :pear: :pencil: :pencil2: :penguin: :pensive: :performing_arts: :persevere: :person_frowning:
   205  :person_with_blond_hair: :person_with_pouting_face: :phone: :pig: :pig2: :pig_nose: :pill: :pineapple: :pisces: :pizza:
   206  `,
   207  
   208  	`**[10] [Emoji Display Test 3]**
   209  :plus1: :point_down: :point_left: :point_right: :point_up: :point_up_2: :police_car: :poodle: :poop: :post_office:
   210  :postal_horn: :postbox: :potable_water: :pouch: :poultry_leg: :pound: :pouting_cat: :pray: :princess: :punch: 
   211  :purple_heart: :purse: :pushpin: :put_litter_in_its_place: :question: :rabbit: :rabbit2: :racehorse: :radio: :radio_button:
   212  :rage: :rage1: :rage2: :rage3: :rage4: :railway_car: :rainbow: :raised_hand: :raised_hands: :raising_hand:
   213  :ram: :ramen: :rat: :recycle: :red_car: :red_circle: :registered: :relaxed: :relieved: :repeat: 
   214  :repeat_one: :restroom: :revolving_hearts: :rewind: :ribbon: :rice: :rice_ball: :rice_cracker: :rice_scene: :ring: 
   215  :rocket: :roller_coaster: :rooster: :rose: :rotating_light: :round_pushpin: :rowboat: :ru:
   216  :rugby_football: :runner: :running: :running_shirt_with_sash: :sa: :sagittarius: :sailboat: :sake: :sandal: :santa: 
   217  :satellite: :satisfied: :saxophone: :school: :school_satchel: :scissors: :scorpius: :scream: :scream_cat: :scroll:
   218  :seat: :secret: :see_no_evil: :seedling: :seven: :shaved_ice: :sheep: :shell: :ship: :shipit:
   219  :shirt: :shit: :shoe: :shower: :signal_strength: :six: :six_pointed_star: :ski: :skull: :sleeping:
   220  :sleepy: :slot_machine: :small_blue_diamond: :small_orange_diamond: :small_red_triangle: :small_red_triangle_down: :smile: :smile_cat: :smiley: :smiley_cat:
   221  :smiling_imp: :smirk: :smirk_cat: :smoking: :snail: :snake: :snowboarder: :snowflake: :snowman: :sob:
   222  :soccer: :soon: :sos: :sound: :space_invader: :spades: :spaghetti: :sparkle: :sparkler: :sparkles:
   223  :sparkling_heart: :speak_no_evil: :speaker: :speech_balloon: :speedboat: :squirrel: :star: :star2: :stars: :station:
   224  :statue_of_liberty: :steam_locomotive: :stew: :straight_ruler: :strawberry: :stuck_out_tongue: :stuck_out_tongue_closed_eyes: :stuck_out_tongue_winking_eye: :sun_with_face: :sunflower:
   225   :sunglasses: :sunny: :sunrise: :sunrise_over_mountains: :surfer: :sushi: :suspect: :suspension_railway: :sweat: :sweat_drops:
   226  :sweat_smile: :sweet_potato: :swimmer: :symbols: :syringe: :tada: :tanabata_tree: :tangerine: :taurus: :taxi:
   227  :tea: :telephone: :telephone_receiver: :telescope: :tennis: :tent: :thought_balloon: :three: :thumbsdown: :thumbsup: 
   228  :ticket: :tiger: :tiger2: :tired_face: :tm: :toilet: :tokyo_tower: :tomato: :tongue: :top:
   229  :tophat: :tractor: :traffic_light: :train: :train2: :tram: :triangular_flag_on_post: :triangular_ruler: :trident: :triumph:
   230  :trolleybus: :trollface: :trophy: :tropical_drink: :tropical_fish: :truck: :trumpet: :tshirt: :tulip: :turtle: 
   231  :tv: :twisted_rightwards_arrows: :two: :two_hearts: :two_men_holding_hands: :two_women_holding_hands: 
   232  :uk: :umbrella: :unamused: :underage: :unlock: :up: :us: :v: :vertical_traffic_light: :vhs: 
   233  :vibration_mode: :video_camera: :video_game: :violin: :virgo: :volcano: :vs: :walking: :waning_crescent_moon: :waning_gibbous_moon:
   234  :warning: :watch: :water_buffalo: :watermelon: :wave: :wavy_dash: :waxing_crescent_moon: :waxing_gibbous_moon: :wc: :weary:
   235  :wedding: :whale: :whale2: :wheelchair: :white_check_mark: :white_circle: :white_flower: :white_large_square: :white_medium_small_square:  :white_medium_square:
   236  :white_small_square: :white_square_button: :wind_chime: :wine_glass: :wink: :wolf: :woman: :womans_clothes: :womans_hat: :womens:
   237  :worried: :wrench: :x: :yellow_heart: :yen: :yum: :zap: :zero: :zzz:
   238  Unnamed: :u5272: :u5408: :u55b6: :u6307: :u6708: :u6709: :u6e80: :u7121: :u7533: :u7981: :u7a7a:
   239  `,
   240  
   241  	`**[11] [Auto Linking]**
   242  #### should be turned into links:
   243  http://example.com
   244  https://example.com
   245  www.example.com
   246  www.example.com/index
   247  www.example.com/index.html
   248  www.example.com/index/sub
   249  www.example.com/index?params=1
   250  www.example.com/index?params=1&other=2
   251  www.example.com/index?params=1;other=2
   252  http://example.com:8065
   253  <http://example.com>
   254  <www.example.com>
   255  http://www.example.com/_/page
   256  www.example.com/_/page
   257  https://en.wikipedia.org/wiki/🐬
   258  https://en.wikipedia.org/wiki/Rendering_(computer_graphics)
   259  http://127.0.0.1
   260  http://192.168.1.1:4040
   261  http://[::1]:80
   262  http://[::1]:8065
   263  https://[::1]:80
   264  http://[2001:0:5ef5:79fb:303a:62d5:3312:ff42]:80
   265  http://[2001:0:5ef5:79fb:303a:62d5:3312:ff42]:8065
   266  https://[2001:0:5ef5:79fb:303a:62d5:3312:ff42]:443
   267  http://username:password@example.com
   268  http://username:password@127.0.0.1
   269  http://username:password@[2001:0:5ef5:79fb:303a:62d5:3312:ff42]:80
   270  test@example.com
   271  
   272  #### should be turned into links which link to the correct place:
   273  [example link](example.com) links to ` + "`" + `http://example.com` + "`" + `
   274  [example.com](example.com) links to ` + "`" + `http://example.com` + "`" + `
   275  [example.com/other](example.com) links to ` + "`" + `http://example.com` + "`" + `
   276  [example.com/other_link](example.com/example) links to ` + "`" + `http://example.com/example` + "`" + `
   277  www.example.com links to ` + "`" + `http://www.example.com` + "`" + `
   278  https://example.com links to ` + "`" + `https://example.com` + "`" + `and not ` + "`" + `http://example.com` + "`" + `
   279  https://en.wikipedia.org/wiki/🐬 links to the Wikipedia article on dolphins
   280  https://en.wikipedia.org/wiki/URLs#Syntax links to the Syntax section of the Wikipedia article on URLs
   281  test@example.com links to ` + "`" + `mailto:test@example.com` + "`" + `
   282  [email link](mailto:test@example.com) links to ` + "`" + `mailto:test@example.com` + "`" + `and not ` + "`" + `http://mailto:test@example.com` + "`" + `
   283  [other link](ts3server://example.com) links to ` + "`" + `ts3server://example.com` + "`" + `and not ` + "`" + `http://ts3server://example.com` + "`" + `
   284  
   285  #### should not be turned into links:
   286  example.com
   287  readme.md
   288  <example.com>
   289  http://
   290  @example.com
   291  
   292  #### should only turn the actual link into a link and not change surrounding text
   293  (http://example.com)
   294  (test@example.com)
   295  This is a sentence with a http://example.com in it.
   296  This is a sentence with a [link](http://example.com) in it.
   297  This is a sentence with a http://example.com/_/underscore in it.
   298  This is a sentence with a link (http://example.com) in it.
   299  This is a sentence with a (https://en.wikipedia.org/wiki/Rendering_(computer_graphics)) in it.
   300  This is a sentence with a http://192.168.1.1:4040 in it.
   301  This is a sentence with a https://::1 in it.
   302  This is a link to http://example.com.
   303  `,
   304  
   305  	"*", "?", ".", "}{][)(><", "{}[]()<>",
   306  
   307  	"qahwah ( قهوة)",
   308  	"שָׁלוֹם עֲלֵיכֶם",
   309  	"Ramen チャーシュー chāshū",
   310  	"言而无信",
   311  	"Ṫ͌ó̍ ̍͂̓̍̍̀i̊ͯ͒",
   312  	"&amp; &lt; &qu",
   313  
   314  	"' or '1'='1' -- ",
   315  	"' or '1'='1' ({ ",
   316  	"' or '1'='1' /* ",
   317  	"1;DROP TABLE users",
   318  
   319  	"<b><i><u><strong><em>",
   320  
   321  	"sue@thatmightbe",
   322  	"sue@thatmightbe.",
   323  	"sue@thatmightbe.c",
   324  	"sue@thatmightbe.co",
   325  	"su+san@thatmightbe.com",
   326  	"a@b.中国",
   327  	"1@2.am",
   328  	"a@b.co.uk",
   329  	"a@b.cancerresearch",
   330  	"local@[127.0.0.1]",
   331  
   332  	"!@$%^&:*.,/|;'\"+=?`~#",
   333  	"'\"/\\\"\"''\\/",
   334  	"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg",
   335  	"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg",
   336  	"ą ć ę ł ń ó ś ź ż č ď ě ň ř š ť ž ă î ø å æ á é í ó ú Ç Ğ İ Ö Ş Ü",
   337  	"abcdefghijklmnopqrstuvwrxyz0123456789 -_",
   338  	"Ṫ͌ó̍ ̍͂̓̍̍̀i̊ͯ͒nͧ̍̓̃͋vok̂̓ͤ̓̂ěͬ ͆tͬ̐́̐͆h̒̏͌̓e͂ ̎̊h̽͆ͯ̄ͮi͊̂ͧͫ̇̃vͥͦ́ẻͤ-͒m̈́̀i̓ͮ͗̑͌̆̅n̓̓ͨd̊̑͛̔̚ ͨͮ̊̾rͪeͭͭ͑ͧ́͋p̈́̅̚rͧe̒̈̌s̍̽ͩ̓̇e͗n̏͊ͬͭtͨ͆ͤ̚iͪ͗̍n͐͒g̾ͦ̎ ͥ͌̽̊ͩͥ͗c̀ͬͣha̍̏̉ͪ̈̚o̊̏s̊̋̀̏̽̚.͒ͫ͛͛̎ͥ",
   339  	"H҉̵̞̟̠̖̗̘Ȅ̐̑̒̚̕̚ IS C̒̓̔̿̿̿̕̚̚̕̚̕̚̕̚̕̚̕̚OMI҉̵̞̟̠̖̗̘NG > ͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿̿̚ ҉ ҉҉̡̢̡̢̛̛̖̗̘̙̜̝̞̟̠̖̗̘̙̜̝̞̟̠̊̋̌̍̎̏̐̑̒̓̔̊̋̌̍̎̏̐̑ ͡҉҉",
   340  
   341  	"<a href=\"//www.google.com\">Teh Googles</a>",
   342  	"<img src=\"//upload.wikimedia.org/wikipedia/meta/b/be/Wikipedia-logo-v2_2x.png\" />",
   343  	"&amp; &lt; &quot; &apos;",
   344  	" %21 %23 %24 %26 %27 %28 %29 %2A	%2B	%2C	%2F	%3A	%3B	%3D	%3F	%40	%5B	%5D %0D %0A %0D%0A %20 %22 %25 %2D %2E %3C %3E %5C %5E %5F %60 %7B %7C %7D %7E",
   345  
   346  	";alert('Well this is awkward.');",
   347  	"<script type='text/javascript'>alert('yay puppies');</script>",
   348  
   349  	"http?q=foobar%0d%0aContent-\nLength:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-\nType:%20text/html%0d%0aContent-Length:%2019%0d%0a%0d%0a<html>Shazam</html>",
   350  
   351  	"apos'trophe@thatmightbe.com",
   352  	"apos''''trophe@thatmightbe.com",
   353  	"su+s+an@thatmightbe.com",
   354  	"per.iod@thatmightbe.com",
   355  	"per..iods@thatmightbe.com",
   356  	".period@thatmightbe.com",
   357  	"tom(comment)@thatmightbe.com",
   358  	"(comment)tom@thatmightbe.com",
   359  	"\"quotes\"@thatmightbe.com",
   360  	"\"\\\"(),:;<>@[\\]\"@thatmightbe.com",
   361  	"a!#$%&'*+-/=?^_`{|}~b@thatmightbe.com",
   362  	"jill@(comment)example.com",
   363  	"jill@example.com(comment)",
   364  	"ben@ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg.com",
   365  	"judy@gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg.com",
   366  	"ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg@AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.com",
   367  }
   368  
   369  // Strings that should pass as acceptable team names
   370  var FUZZY_STRINGS_NAMES = []string{
   371  	"*",
   372  	"?",
   373  	".",
   374  	"}{][)(><",
   375  	"{}[]()<>",
   376  
   377  	"qahwah ( قهوة)",
   378  	"שָׁלוֹם עֲלֵיכֶם",
   379  	"Ramen チャーシュー chāshū",
   380  	"言而无信",
   381  	"Ṫ͌ó̍ ̍͂̓̍̍̀i̊ͯ͒",
   382  	"&amp; &lt; &qu",
   383  
   384  	"' or '1'='1' -- ",
   385  	"' or '1'='1' ({ ",
   386  	"' or '1'='1' /* ",
   387  	"1;DROP TABLE users",
   388  
   389  	"<b><i><u><strong><em>",
   390  
   391  	"sue@thatmightbe",
   392  	"sue@thatmightbe.",
   393  	"sue@thatmightbe.c",
   394  	"sue@thatmightbe.co",
   395  	"sue @ thatmightbe.com",
   396  	"apos'trophe@thatmightbe.com",
   397  	"apos''''trophe@thatmightbe.com",
   398  	"su+san@thatmightbe.com",
   399  	"su+s+an@thatmightbe.com",
   400  	"per.iod@thatmightbe.com",
   401  	"per..iods@thatmightbe.com",
   402  	".period@thatmightbe.com",
   403  	"tom(comment)@thatmightbe.com",
   404  	"(comment)tom@thatmightbe.com",
   405  	"\"quotes\"@thatmightbe.com",
   406  	"\"\\\"(),:;<>@[\\]\"@thatmightbe.com",
   407  	"a!#$%&'*+-/=?^_`{|}~b@thatmightbe.com",
   408  	"local@[127.0.0.1]",
   409  	"jill@(comment)example.com",
   410  	"jill@example.com(comment)",
   411  	"a@b.中国",
   412  	"1@2.am",
   413  	"a@b.co.uk",
   414  	"a@b.cancerresearch",
   415  
   416  	"<a href=\"//www.google.com\">Teh Googles</a>",
   417  	"<img src=\"//upload.wikimedia.org/wikipelogo-v2_2x.png\" />",
   418  	"<b><i><u><strong><em>",
   419  	"&amp; &lt; &quot; &apos;",
   420  
   421  	";alert('Well this is awkward.');",
   422  	"<script type='text/javascript'>alert('yay puppies');</script>",
   423  
   424  	"Ṫ͌ó̍ ̍͂̓̍̍̀i̊ͯ͒nͧ̍̓̃͋v",
   425  	"H҉̵̞̟̠̖̗̘Ȅ̐̐̑̒̚OMI҉̵̞̟̠",
   426  }
   427  
   428  // Strings that should pass as acceptable emails
   429  var FUZZY_STRINGS_EMAILS = []string{
   430  	"sue@thatmightbe",
   431  	"sue@thatmightbe.c",
   432  	"sue@thatmightbe.co",
   433  	"su+san@thatmightbe.com",
   434  	"1@2.am",
   435  	"a@b.co.uk",
   436  	"a@b.cancerresearch",
   437  	"su+s+an@thatmightbe.com",
   438  	"per.iod@thatmightbe.com",
   439  }
   440  
   441  // Lovely giberish for all to use
   442  const GIBBERISH_TEXT = `
   443  Thus one besides much goodness shyly far some hyena overtook since rhinoceros nodded withdrew wombat before deserved apart a alongside the far dalmatian less ouch where yet a salmon.
   444  Then jeez far marginal hey aboard more as leaned much oversold that inside spoke showed much went crud close save so and and after and informally much lion commendably less conductive oh excepting conductive compassionate jeepers hey a much leopard alas woolly untruthful outside snug rashly one cunning past fabulous adjusted far woodchuck and and indecisive crud loving exotic less resolute ladybug sprang drank under following far the as hence passably stolidly jeez the inset spaciously more cozily fishily the hey alas petted one audible yikes dear preparatory darn goldfinch gosh a then as moth more guinea.
   445  Timid mislaid as salamander yikes alas ouch much that goldfinch shark in before instead dear one swore vivid versus one until regardless sang panther tolerable much preparatory hardily shuddered where coquettish far sheep coarsely exaggerated preparatory because cordial awesome gradually nutria that dear mocking behind off staunchly regarding a the komodo crud shrewd well jeez iguanodon strove strived and moodily and sought and and mounted gosh aboard crud spitefully boa.
   446  One as highhanded fortuitous angelfish so one woodchuck dazedly kangaroo nasty instead far parrot away the worm yet testy where caribou a cuckoo onto dear reined because less tranquil kindhearted and shuddered plankton astride monkey methodically above evasive otter this wrung and courageous iguana wayward along cowered prior a.
   447  Freely since ouch octopus the heated apart on hey the some pending placed fearless jeepers hardheadedly more that less jolly bit cuddled.
   448  Caterpillar laboriously far wistful spilled aside far oriole newt and immeasurably yikes revealed raptly obdurately definitely scallop titilatingly one alongside monumentally ouch much wretched the spoke a before alas insolent abortive that turned hey hare much poignantly re-laid goodness yet the dear compassionate a hey scooped sped darn warmly oh and more darn craven that overtook fell and bluebird misheard that needless less ravenously in positively far romantically some babbled that rose honey then immaturely this and jollily irresistible much rarely earthworm parrot wow.
   449  Less less bluntly jeez at goodness panther opposite oh purred a pathetically mildly less cat badly much much on from obscure in gull off manatee hatchet goodness euphemistically hence or understandable after this so that thus shook hence that mindfully yellow behind far bat wayward thanks more wrote so the flapped however alas and mallard that temperately irritably yikes squirrel.
   450  Some reset some therefore demonstrably considering dachshund kindhearted far wow far whispered far clung this by partook much upon fit inscrutably so affirmative diligently far grinned and manifestly hummingbird hello caudal considering when aboard much buoyantly that unfitting far attractively far during much crud baneful jeez one toneless cynically oh spurious athletic meadowlark much generously one subconsciously arguable much forthrightly hawk inoffensively.
   451  Snorted tidy stiffly against one fiendishly began burst hey revealed a beside the soothingly ceremonially affirmatively cowered when fitted this static hello emoted assenting however while far that gross besides because and dear.
   452  Far therefore the blushed momentously the however one a wholeheartedly and considering incessantly that neurotically wore firefly grouped impotently dear one abjectly goodness so far a honey far insolently far so greyhound between above raucously echidna more halfhearted thankful squid one.
   453  Raccoon cockatoo this while but this a far among ouch and hey alas scallop black sane as yikes hello sexy far tacky and balked wrongly more near shrewdly the yet gosh much caribou ruthlessly a on far a threw well less at the one after.
   454  Spoke touched barbarously before much thus therefore darn scratched oh howled the less much hello after and jeez flagrantly weirdly crud komodo fabulous the much some cow jeering much egregiously a bucolically a admirably jeepers essential when ouch and tapir this while and wolverine.
   455  Cm more much in this rewrote ouch on from aside wildebeest crane saddled where much opposite endearingly hummingbird together some beside a the goodness dear ouch ouch struck the input smooched shrugged until slick as waked hawk sincere irksomely.
   456  Camel the pulled this richly grimaced leopard more false thought dear militant added yikes supp infallibly set orca beat hello while accurately reliably while lorikeet one strategic less hello without and smooched across plankton but jeepers pangolin the rich seal sneered pre-set lynx on radical nasty alas onto more hence flabby outbid murkily congenially dived much lubber added far eccentrically turtle before outsold onto ouch thus much and hawk tolerable much knitted yikes shot much limpet one this woolly much however hence up angry up well.
   457  Unicorn yawned hello boundless this when express jaded closed wept tranquil after came airily merry much dismounted for much extensively less interminably far one far armadillo pled dolphin alas nutria and more oh positively koala grizzly after falcon goat strict hooted next browbeat split more far far antagonistic lingering the depending pending sheared since up before jeepers distant mastodon dropped as this more some much set far infinitesimal well shark grasshopper as hey one via some fishy and immaturely remote where weasel leopard annoying correctly wherever that sniffled much mandrill on jeez adventurous much.
   458  Jeepers before spitefully buoyant concentric the reset moth a darn decidedly baboon giraffe outrageously groundhog on one at more overslept gosh worm away far far less much hysteric showed on so rattlesnake the and immature yikes baneful hence wow lynx hence past scornfully groaned pounded dived this one outside dachshund scowled one prior tenable therefore before scratched much much drank hey while added rabbit shark and supp cut this ironic limpet hedgehog bound more rebuking the jeepers thorough while more far due but yikes nastily brave dangerous opened tangibly aside after acrimoniously one cackled scratched.
   459  Canny salmon hatchet more far opposite much coughed excited expedient far lizard one indiscriminate yikes jeez powerlessly forcefully tiger rooster and brought far more during this sank onto after then less amorally rude unerring some alongside irrespective bat hungrily kangaroo extravagantly inside ouch much gosh dreadfully oh much darn prior as fired guinea.
   460  Irksomely upon up for amicably one since contrary one until flamingo tarantula far koala despite easy well gazelle ungracefully rose less that under hey more criminal unique furrowed so disbanded normal where one a a hey circuitous ouch feverish for the kookaburra and pithy far far then more the versus cliquishly across oh and explicitly much therefore as tamely alongside underlay much yikes imminently off however far across instantaneous therefore wallaby evidently foul foretold as far a jeepers invidious bearish.
   461  More and until scandalously after wallaby petted oh much as poked much caterpillar drank beside rode actively walking scooped weird this duteous that far before human during dear house thrust more flinched opposite that ahead in far.
   462  The painful essential jeepers merrily proudly essential and less far dismounted inside mongoose beyond confessedly robin shined heron the during since according suggestively and less some strident combed alas much man-of-war forgave so and to then inanimately.
   463  Beside far this this a crud polite cantankerous exclusively misheard pled far circuitously and frugal less more temperately gauche goldfinch oh against this along excitedly goodhearted more classically quit serenely outside vulture ouch after one a this yet.
   464  Less and handsomely manatee some amidst much reined komodo busted exultingly but fatuously less across mighty goodness objective alas glaringly gregariously hello the since one pridefully much well placed far less goodness jellyfish unnecessary reciprocating a far stylistic gazed one.
   465  Hey rethought excepting lamely much and naughtily amidst more since jeez then bluebird hence less bald by some brought left the across logic loyal brightly jeez capitally that less more forward rebound a yikes chose convulsively confidently repeated broadcast much dipped when awesomely or some some regal the scowled merry zebra since more credible so inescapably fetchingly and lantern that due dear one went gosh wow well furrowed much much specially spoiled as vitally instead the seriously some rooster irrespective well imprecisely rapidly more llama.
   466  Up to and hey without pill that this squid alas brusque on inventoried and spread the more excepting aristocratically due piquant wove beneath that macaw in more until much grimaced far and jeez enticingly unicorn some far crab more barring purely jeepers clear groomed glaring hey dear hence before the the this hello.`
   467  
   468  func RandString(l int, charset string) string {
   469  	ret := make([]byte, l)
   470  	for i := 0; i < l; i++ {
   471  		ret[i] = charset[rand.Intn(len(charset))]
   472  	}
   473  	return string(ret)
   474  }
   475  
   476  // func RandomEmail(length Range, charset string) string {
   477  // 	emaillen := RandIntFromRange(length)
   478  // 	username := RandString(emaillen, charset)
   479  // 	domain := "simulator.amazonses.com"
   480  // 	return "success+" + username + "@" + domain
   481  // }
   482  
   483  // func FuzzEmail() string {
   484  // 	return FUZZY_STRINGS_EMAILS[RandIntFromRange(Range{0, len(FUZZY_STRINGS_EMAILS) - 1})]
   485  // }
   486  
   487  func RandomName(length Range, charset string) string {
   488  	namelen := RandIntFromRange(length)
   489  	return RandString(namelen, charset)
   490  }
   491  
   492  func FuzzName() string {
   493  	return FUZZY_STRINGS_NAMES[RandIntFromRange(Range{0, len(FUZZY_STRINGS_NAMES) - 1})]
   494  }
   495  
   496  // Random selection of text for post
   497  func RandomText(length Range, hashtags Range, mentions Range, users []string) string {
   498  	textLength := RandIntFromRange(length)
   499  	numHashtags := RandIntFromRange(hashtags)
   500  	numMentions := RandIntFromRange(mentions)
   501  	if textLength > len(GIBBERISH_TEXT) || textLength < 0 {
   502  		textLength = len(GIBBERISH_TEXT)
   503  	}
   504  	startPosition := RandIntFromRange(Range{0, len(GIBBERISH_TEXT) - textLength - 1})
   505  
   506  	words := strings.Split(GIBBERISH_TEXT[startPosition:startPosition+textLength], " ")
   507  	for i := 0; i < numHashtags; i++ {
   508  		randword := RandIntFromRange(Range{0, len(words) - 1})
   509  		words = append(words, " #"+words[randword])
   510  	}
   511  	if len(users) > 0 {
   512  		for i := 0; i < numMentions; i++ {
   513  			randuser := RandIntFromRange(Range{0, len(users) - 1})
   514  			words = append(words, " @"+users[randuser])
   515  		}
   516  	}
   517  
   518  	// Shuffle the words
   519  	for i := range words {
   520  		j := rand.Intn(i + 1)
   521  		words[i], words[j] = words[j], words[i]
   522  	}
   523  
   524  	return strings.Join(words, " ")
   525  }
   526  
   527  func FuzzPost() string {
   528  	return FUZZY_STRINGS_POSTS[RandIntFromRange(Range{0, len(FUZZY_STRINGS_POSTS) - 1})]
   529  }