crypt
Crypt module. Does various encryption things
- crypt
- static
- .description :
String
- .configuration :
Object
- .enabled :
Boolean
- .name :
String
- .priority :
Number
- .version :
String
- .commands :
Object
- .rot13 :
Object
- .reverse :
Object
- .xorbc :
Object
- .rxorbc :
Object
- .random :
Object
- .onNotify(type, notification, topic, post, callback)
- .begin(browser, config)
- .description :
- inner
- ~cryptCmd(handler) ⇒
function
- ~xorbc(decrypt)
- ~toCharCodes(s) ⇒
Array
- ~zeroArray(l) ⇒
Array
- ~cryptCmd(handler) ⇒
crypt.description : String
Description, for help text.
Kind: static property of crypt
crypt.configuration : Object
The config for the module
Kind: static property of crypt
configuration.enabled : Boolean
Should the module be enabled?
Kind: static property of configuration
crypt.name : String
The name of this sock module
Kind: static property of crypt
crypt.priority : Number
The priority of the sock module
Kind: static property of crypt
crypt.version : String
The version of this module
Kind: static property of crypt
crypt.commands : Object
Each command is an encryption mechanism and has the following properties: - handler: The encryption function. - defaults: Default values of parameters - params: Named parameters for this function - randomPickable: If true, random encryption can select this function. NOTE: random currently does not support parameters. - description: A description of this function for the help
Kind: static property of crypt
- .commands :
Object
commands.rot13 : Object
ROT13 "encryption"
Kind: static property of commands
commands.reverse : Object
Reverse the string
Kind: static property of commands
commands.xorbc : Object
XOR with block chaining
Kind: static property of commands
commands.rxorbc : Object
Reverse XOR with block chaining
Kind: static property of commands
commands.random : Object
Random other command
Kind: static property of commands
crypt.onNotify(type, notification, topic, post, callback)
Use a random encryption when PMed/mentioned/replied without command
Kind: static method of crypt
Param | Type | Description |
---|---|---|
type | string |
The type of event. Only responds if this is 'mentioned' |
notification | string |
The notification to respond to |
topic | string |
Unused. |
post | string |
The post the notification was for |
callback | function |
The callback to notify when processing is complete. |
crypt.begin(browser, config)
Bootstrap the module
Kind: static method of crypt
Param | Type | Description |
---|---|---|
browser | string |
discourse. |
config | object |
The configuration to use |
crypt~cryptCmd(handler) ⇒ function
Helper to chain encryptions
Kind: inner method of crypt
Returns: function
- A curried version of that handler, assuming this author is using the word "curried" correctly
Param | Type | Description |
---|---|---|
handler | function |
The handler |
crypt~xorbc(decrypt)
xorbc implementatioon. Homegrown and weak as shit but who cares
Kind: inner method of crypt
Param | Type | Description |
---|---|---|
decrypt | boolean |
Whether this should be decrypted or not |
crypt~toCharCodes(s) ⇒ Array
Convert string to array of character codes
Kind: inner method of crypt
Returns: Array
- an array of character codes
Param | Type | Description |
---|---|---|
s | string |
The string |
crypt~zeroArray(l) ⇒ Array
Create array with constant value
Kind: inner method of crypt
Returns: Array
- an array of all 0s
Param | Type | Description |
---|---|---|
l | Number |
The length of the array to make |