Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
drd0rk committed Dec 21, 2011
0 parents commit 8a9e34c
Show file tree
Hide file tree
Showing 66 changed files with 9,664 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.*~
38 changes: 38 additions & 0 deletions lib/strgen.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = class StrGen

# the length of the generated string
@strLength = 64

# available character sets
@chars =
"abc": "abcdefghijklmnopqrstuvwxyz"
"ABC": "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"digits": "0123456789"
"special_email": "-_."
"special_other": "@|:;#~'`?}{][&%$§!><+*/()"

@alphabet = ""

# generates the random string
@generate: () ->
resultStr = ""
for i in [0..@strLength-1]
randNum = Math.floor(Math.random() * @alphabet.length);
resultStr += @alphabet[randNum];
resultStr


# define the length of the generated string
@setLength: (len) ->
throw new Error "String length must be at least 2, "+len+" given" if len < 2
@strLength = len

# define the alphabet of the generated string
@setAlphabet: (alphabet) ->
switch alphabet
when "ascii" then @alphabet = (String.fromCharCode(num) for num in [33..255] when num isnt 127)
when "email" then @alphabet = @chars.abc.concat @chars.ABC.concat @chars.digits.concat @chars.special_email
when "typical" then @alphabet = @chars.abc.concat @chars.ABC.concat @chars.digits.concat @chars.special_email.concat @chars.special_other
else @alphabet = alphabet


1 change: 1 addition & 0 deletions node_modules/.bin/cake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/coffee

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/vows

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions node_modules/coffee-script/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions node_modules/coffee-script/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions node_modules/coffee-script/README

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 78 additions & 0 deletions node_modules/coffee-script/Rakefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/coffee-script/bin/cake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/coffee-script/bin/coffee

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions node_modules/coffee-script/extras/jsl.conf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions node_modules/coffee-script/lib/coffee-script/browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8a9e34c

Please sign in to comment.