Skip to content

Instantly share code, notes, and snippets.

@wynnzen
Created May 13, 2014 02:42
Show Gist options
  • Save wynnzen/8fdf3eacfc4647d6afa9 to your computer and use it in GitHub Desktop.
Save wynnzen/8fdf3eacfc4647d6afa9 to your computer and use it in GitHub Desktop.
randomssid
import random
def randomssid(self, length=255):
randomvalue = list()
for i in range(length):
val_cjk = random.randint(0x4E00, 0x9FBF) # CJK
val_ascii = random.randint(0x0020, 0x007e) # ascii
val_fascii = random.randint(0xff01, 0xff64) # fullwidth ascii
randomvalue.append(
unichr(random.choice([val_cjk, val_ascii, val_fascii])))
return randomvalue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment