function encrypt(text){ | |
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq') | |
var crypted = cipher.update(text,'utf8','hex') | |
crypted += cipher.final('hex'); | |
return crypted; | |
} | |
function decrypt(text){ | |
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq') | |
var dec = decipher.update(text,'hex','utf8') |
Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.
As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:
- publish
- request
- start/stop subscription
#!/bin/sh | |
# http://www.marcusoft.net/2014/03/setting-up-complete-node-development.html | |
clear | |
echo "******************************************************************************" | |
echo "Don't go anywhere - I'm going to need your input shortly.." | |
read -p "[Enter to continue]" | |
### Set up dependencies | |
# Configure sources & repos |
/** | |
* Simple node_acl example with mongoDB and expressjs | |
* | |
* Usage: | |
* 1. Start this as server | |
* 2. Play with the resoures | |
* | |
* Show all permissions (as JSON) | |
* http://localhost:3500/info | |
* |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/