mirror of
git://git.acid.vegas/random.git
synced 2024-11-14 12:06:38 +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.
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
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()
|
||||
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]))
|
||||
else:
|
||||
confused += char
|
||||
@ -32,11 +39,11 @@ confusable = {
|
||||
'>':'ᐳ>',
|
||||
'?':'?',
|
||||
'@':'@',
|
||||
'0':'OΟОՕ௦౦೦ഠဝ၀ჿዐᴏᴑⲞⲟⵔ〇ꓳ0Oo𐊒𐊫𐐄𐐬𐓂𐓪',
|
||||
'1':'lı1',
|
||||
'0':'߀𝛰〇𐊒𝟬𝜪Oዐ𝞞𝝤ⵔՕ𝟢𝗢𝘖ⲞОΟଠ𝟎𝐎০୦O𐊫𝙾ꓳ𐐄𝟶𝑶𝚶𐓂௦౦೦ഠဝ၀ჿᴏᴑⲟ0o𐐬𐓪',
|
||||
'1':'𝚕𝟏𝟙𝟣𝟭𝟷',
|
||||
'2':'Ƨᒿ2𝟐𝟤𝟮𝟸',
|
||||
'3':'ƷȜЗӠⳌꝪꞫ3',
|
||||
'4':'Ꮞ4',
|
||||
'4':'Ꮞ𝟒𝟜𝟦𝟰𝟺',
|
||||
'5':'Ƽ5',
|
||||
'6':'бᏮⳒ6',
|
||||
'7':'7𐓒',
|
||||
@ -73,11 +80,11 @@ confusable = {
|
||||
'd':'ԁᏧᑯⅆⅾꓒd𝐝𝑑𝒅𝒹𝓭𝖽𝗱𝘥𝙙𝚍',
|
||||
'e':'еҽ℮e𝐞𝕖𝖾𝗲𝚎',
|
||||
'f':'ẝꞙꬵf',
|
||||
'g':'ƍɡցᶃg𝐠𝑔𝒈𝓰𝔤𝕘𝖌𝗀𝗴𝘨𝙜𝚐',
|
||||
'g':'ƍɡցᶃg𝐠𝑔𝒈𝕘𝖌𝗀𝗴𝘨𝙜𝚐',
|
||||
'h':'һᏂℎh𝒉𝕙𝗁𝗵𝘩𝙝𝚑',
|
||||
'j':'ϳјj𝐣𝚓',
|
||||
'k':'k𝐤𝑘𝒌𝕜𝖐𝗄𝗸𝘬𝙠𝚔',
|
||||
'm':'m',
|
||||
'm':'m𝕞𝙢𝗺ⅿ',
|
||||
'n':'ոռn𝗇𝗻𝘯𝙣𝚗',
|
||||
'o':'OΟОՕ௦౦೦ഠဝ၀ჿዐᴏᴑⲞⲟⵔ〇ꓳ0Oo𐊒𐊫𐐄𐐬𐓂𐓪',
|
||||
'p':'ρϱр⍴ⲣp𝑝𝕡𝗉𝗽𝘱𝙥𝚙𝛒𝜌𝝆𝞀𝞺',
|
||||
@ -91,4 +98,5 @@ confusable = {
|
||||
'x':'×хⅹ⤫⤬⨯x𝐱𝑥𝒙𝔵𝕩𝖝𝗑𝘅𝘹𝙭𝚡',
|
||||
'y':'ɣγуүყỿꭚy',
|
||||
'z':'ᴢꮓz'
|
||||
'z':'𝙯ᴢ𝗓𝕫ꮓ𝚣𝒛'
|
||||
}
|
Loading…
Reference in New Issue
Block a user