view on requirebin
Created
August 7, 2013 00:47
-
-
Save brianleroux/6170281 to your computer and use it in GitHub Desktop.
requirebin sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require something | |
var c = require('caesar-cipher') | |
var d = c.encrypt(13, 'Hello world') | |
alert(d) | |
alert(c.decrypt(13, d)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require=function(r,e,t){function n(t,i){if(!e[t]){if(!r[t]){var c="function"==typeof require&&require;if(!i&&c)return c(t,!0);if(o)return o(t,!0);throw Error("Cannot find module '"+t+"'")}var u=e[t]={exports:{}};r[t][0].call(u.exports,function(e){var o=r[t][1][e];return n(o?o:e)},u,u.exports)}return e[t].exports}for(var o="function"==typeof require&&require,i=0;t.length>i;i++)n(t[i]);return n}({"caesar-cipher":[function(r,e){e.exports=r("jj0kqo")},{}],jj0kqo:[function(r,e){function t(r,e){/^-?\d+$/.test(r)||console.error("Shift is not an integer"),(0>r||r>=26)&&console.error("Shift is out of range");for(var t="",n=e.length,o=0;n>o;o++){var i=e.charCodeAt(o);t+=i>=65&&90>=i?String.fromCharCode((i-65+r)%26+65):i>=97&&122>=i?String.fromCharCode((i-97+r)%26+97):e.charAt(o)}return t}e.exports={encrypt:function(r,e){return t(r,e)},decrypt:function(r,e){return t((26-r)%26,e)}}},{}]},{},[]);var c=require("caesar-cipher"),d=c.encrypt(13,"Hello world");alert(d),alert(c.decrypt(13,d)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; } | |
body, html { height: 100%; width: 100%; }</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment