Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 22 lines (19 sloc) 0.473 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Description:
# Base64 encoding and decoding
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
# hubot base64 encode|decode <query> - Base64 encode or decode <string>
#
# Author:
# jimeh

module.exports = (robot) ->
  robot.respond /base64 encode( me)? (.*)/i, (msg) ->
    msg.send new Buffer(msg.match[2]).toString('base64')

  robot.respond /base64 decode( me)? (.*)/i, (msg) ->
    msg.send new Buffer(msg.match[2], 'base64').toString('utf8')
Something went wrong with that request. Please try again.