-
-
Save bclinkinbeard/6445373 to your computer and use it in GitHub Desktop.
CommonJS format
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
| var supplant = require('utils/supplant'); | |
| function rhex(n) { | |
| var s = '', j = 0; | |
| for (; j < 4; j++) { | |
| s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F]; | |
| } | |
| return s; | |
| } | |
| function hex(x) { | |
| for (var i = 0; i < x.length; i++) { | |
| x[i] = rhex(x[i]); | |
| } | |
| return x.join(''); | |
| } | |
| module.exports = function () { | |
| // Build an instance of the md5 object with encrypt() features only... | |
| return { | |
| encrypt: function (s) { | |
| var results = hex(s); | |
| console.log(supplant('md5::encrypt({0}) = {1}', [ s, results])); | |
| return results; | |
| } | |
| }; | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Correct.
http://dontkry.com/posts/code/browserify-and-the-universal-module-definition.html
http://esa-matti.suuronen.org/blog/2013/03/22/journey-from-requirejs-to-browserify/
http://killdream.github.io/2013/06/06/node-modules-to-rule-them-all.html