Skip to content

Instantly share code, notes, and snippets.

@deepakduggirala
deepakduggirala / haskell precedence.md
Last active June 10, 2018 08:26
Haskell Precendence
Precedence Left associative operators Non-associative operators Right associative operators
9 !! .
8 ^, ^^, **
7 *, /, `div`, `mod`, `rem`, `quot`
6 +, -
5 :, ++
4 ==, /=, <, <=, >, >=,`elem
@deepakduggirala
deepakduggirala / crypto.js
Created December 17, 2017 05:54
Encryption and Decryption using Node.js
// Part of https://github.com/chris-rock/node-crypto-examples
// Nodejs encryption with CTR
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
function encrypt(text){
var cipher = crypto.createCipher(algorithm,password)
var crypted = cipher.update(text,'utf8','hex')