Skip to content
Newer
Older
100644 22 lines (19 sloc) 473 Bytes
b10ac8c @tombell Update "b" scripts help comments
tombell authored Jun 8, 2012
1 # Description:
2 # Base64 encoding and decoding
3 #
4 # Dependencies:
5 # None
6 #
7 # Configuration:
8 # None
9 #
10 # Commands:
11 # hubot base64 encode|decode <query> - Base64 encode or decode <string>
12 #
13 # Author:
14 # jimeh
60c2976 @jimeh Base64 encode and decode strings
jimeh authored Apr 15, 2012
15
16 module.exports = (robot) ->
17 robot.respond /base64 encode( me)? (.*)/i, (msg) ->
18 msg.send new Buffer(msg.match[2]).toString('base64')
19
20 robot.respond /base64 decode( me)? (.*)/i, (msg) ->
21 msg.send new Buffer(msg.match[2], 'base64').toString('utf8')
Something went wrong with that request. Please try again.