mirror of
git://git.acid.vegas/random.git
synced 2024-12-04 21:46:40 +00:00
Updated
This commit is contained in:
parent
8cde9a65ee
commit
f654c9f56f
@ -5,14 +5,21 @@
|
|||||||
This script contains a dictionary of keyboard typable characters unicode variants that are very similar.
|
This script contains a dictionary of keyboard typable characters unicode variants that are very similar.
|
||||||
Other possible variants exist, for now we are only matching the ones that do not "look" like unicode.
|
Other possible variants exist, for now we are only matching the ones that do not "look" like unicode.
|
||||||
This can be used to evade spam filtering by replacing characters with their similar unicode variants.
|
This can be used to evade spam filtering by replacing characters with their similar unicode variants.
|
||||||
|
|
||||||
|
Todo:
|
||||||
|
- Convert unicode characters into raw codepoints in the dictionary (Example: \u202e)
|
||||||
|
- Add variants for missing typable characters (iIl)
|
||||||
|
- Extend to more variants than already in the database
|
||||||
|
- Set different odds on character replacement for chance feature on the confuse function
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
def confuse(data):
|
def confuse(data, chance=False):
|
||||||
|
'''chance set to True will give each replacable character a 50% chance of being replaced'''
|
||||||
confused = str()
|
confused = str()
|
||||||
for char in data:
|
for char in data:
|
||||||
if char in confusable:
|
if char in confusable and (not chance or random.choice((True,False))):
|
||||||
confused += random.choice(list(confusable[char]))
|
confused += random.choice(list(confusable[char]))
|
||||||
else:
|
else:
|
||||||
confused += char
|
confused += char
|
||||||
@ -32,11 +39,11 @@ confusable = {
|
|||||||
'>':'ᐳ>',
|
'>':'ᐳ>',
|
||||||
'?':'?',
|
'?':'?',
|
||||||
'@':'@',
|
'@':'@',
|
||||||
'0':'OΟОՕ௦౦೦ഠဝ၀ჿዐᴏᴑⲞⲟⵔ〇ꓳ0Oo𐊒𐊫𐐄𐐬𐓂𐓪',
|
'0':'߀𝛰〇𐊒𝟬𝜪Oዐ𝞞𝝤ⵔՕ𝟢𝗢𝘖ⲞОΟଠ𝟎𝐎০୦O𐊫𝙾ꓳ𐐄𝟶𝑶𝚶𐓂௦౦೦ഠဝ၀ჿᴏᴑⲟ0o𐐬𐓪',
|
||||||
'1':'lı1',
|
'1':'𝚕𝟏𝟙𝟣𝟭𝟷',
|
||||||
'2':'Ƨᒿ2𝟐𝟤𝟮𝟸',
|
'2':'Ƨᒿ2𝟐𝟤𝟮𝟸',
|
||||||
'3':'ƷȜЗӠⳌꝪꞫ3',
|
'3':'ƷȜЗӠⳌꝪꞫ3',
|
||||||
'4':'Ꮞ4',
|
'4':'Ꮞ𝟒𝟜𝟦𝟰𝟺',
|
||||||
'5':'Ƽ5',
|
'5':'Ƽ5',
|
||||||
'6':'бᏮⳒ6',
|
'6':'бᏮⳒ6',
|
||||||
'7':'7𐓒',
|
'7':'7𐓒',
|
||||||
@ -50,7 +57,7 @@ confusable = {
|
|||||||
'F':'ϜᖴꓝꞘF𐊇𐊥𝟋',
|
'F':'ϜᖴꓝꞘF𐊇𐊥𝟋',
|
||||||
'G':'ɢԌᏀᏳᏻꓖꮐG𝐆𝐺𝑮𝔾𝖦𝗚𝘎𝙂𝙶',
|
'G':'ɢԌᏀᏳᏻꓖꮐG𝐆𝐺𝑮𝔾𝖦𝗚𝘎𝙂𝙶',
|
||||||
'H':'ʜΗНнᎻᕼⲎꓧH𐋏𝐇𝐻𝑯𝖧𝗛𝘏𝙃𝚮𝛨𝜢𝝜𝞖',
|
'H':'ʜΗНнᎻᕼⲎꓧH𐋏𝐇𝐻𝑯𝖧𝗛𝘏𝙃𝚮𝛨𝜢𝝜𝞖',
|
||||||
'J':'ͿЈᎫᒍᴊꓙꞲꭻJ𝐉 𝐽 𝑱𝕁𝖩𝗝 𝙹',
|
'J':'ͿЈᎫᒍᴊꓙꞲꭻJ𝐉𝐽𝑱𝕁𝖩𝗝𝙹',
|
||||||
'K':'ΚКᏦᛕKⲔꓗK',
|
'K':'ΚКᏦᛕKⲔꓗK',
|
||||||
'L':'ʟᏞᒪⅬⳐⳑꓡꮮL𐐛𐑃',
|
'L':'ʟᏞᒪⅬⳐⳑꓡꮮL𐐛𐑃',
|
||||||
'M':'ΜϺМᎷᗰᛖⅯⲘꓟM𐊰𐌑𝐌𝑀𝑴𝕄𝖬𝗠𝘔𝙈𝙼𝚳𝛭𝜧𝝡𝞛',
|
'M':'ΜϺМᎷᗰᛖⅯⲘꓟM𐊰𐌑𝐌𝑀𝑴𝕄𝖬𝗠𝘔𝙈𝙼𝚳𝛭𝜧𝝡𝞛',
|
||||||
@ -73,11 +80,11 @@ confusable = {
|
|||||||
'd':'ԁᏧᑯⅆⅾꓒd𝐝𝑑𝒅𝒹𝓭𝖽𝗱𝘥𝙙𝚍',
|
'd':'ԁᏧᑯⅆⅾꓒd𝐝𝑑𝒅𝒹𝓭𝖽𝗱𝘥𝙙𝚍',
|
||||||
'e':'еҽ℮e𝐞𝕖𝖾𝗲𝚎',
|
'e':'еҽ℮e𝐞𝕖𝖾𝗲𝚎',
|
||||||
'f':'ẝꞙꬵf',
|
'f':'ẝꞙꬵf',
|
||||||
'g':'ƍɡցᶃg𝐠𝑔𝒈𝓰𝔤𝕘𝖌𝗀𝗴𝘨𝙜𝚐',
|
'g':'ƍɡցᶃg𝐠𝑔𝒈𝕘𝖌𝗀𝗴𝘨𝙜𝚐',
|
||||||
'h':'һᏂℎh𝒉𝕙𝗁𝗵𝘩𝙝𝚑',
|
'h':'һᏂℎh𝒉𝕙𝗁𝗵𝘩𝙝𝚑',
|
||||||
'j':'ϳјj𝐣𝚓',
|
'j':'ϳјj𝐣𝚓',
|
||||||
'k':'k𝐤𝑘𝒌𝕜𝖐𝗄𝗸𝘬𝙠𝚔',
|
'k':'k𝐤𝑘𝒌𝕜𝖐𝗄𝗸𝘬𝙠𝚔',
|
||||||
'm':'m',
|
'm':'m𝕞𝙢𝗺ⅿ',
|
||||||
'n':'ոռn𝗇𝗻𝘯𝙣𝚗',
|
'n':'ոռn𝗇𝗻𝘯𝙣𝚗',
|
||||||
'o':'OΟОՕ௦౦೦ഠဝ၀ჿዐᴏᴑⲞⲟⵔ〇ꓳ0Oo𐊒𐊫𐐄𐐬𐓂𐓪',
|
'o':'OΟОՕ௦౦೦ഠဝ၀ჿዐᴏᴑⲞⲟⵔ〇ꓳ0Oo𐊒𐊫𐐄𐐬𐓂𐓪',
|
||||||
'p':'ρϱр⍴ⲣp𝑝𝕡𝗉𝗽𝘱𝙥𝚙𝛒𝜌𝝆𝞀𝞺',
|
'p':'ρϱр⍴ⲣp𝑝𝕡𝗉𝗽𝘱𝙥𝚙𝛒𝜌𝝆𝞀𝞺',
|
||||||
@ -91,4 +98,5 @@ confusable = {
|
|||||||
'x':'×хⅹ⤫⤬⨯x𝐱𝑥𝒙𝔵𝕩𝖝𝗑𝘅𝘹𝙭𝚡',
|
'x':'×хⅹ⤫⤬⨯x𝐱𝑥𝒙𝔵𝕩𝖝𝗑𝘅𝘹𝙭𝚡',
|
||||||
'y':'ɣγуүყỿꭚy',
|
'y':'ɣγуүყỿꭚy',
|
||||||
'z':'ᴢꮓz'
|
'z':'ᴢꮓz'
|
||||||
|
'z':'𝙯ᴢ𝗓𝕫ꮓ𝚣𝒛'
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user