Skip to content

Instantly share code, notes, and snippets.

View dorman99's full-sized avatar
🎯
Focusing

Muhammad Hafizh Abdillah AR dorman99

🎯
Focusing
View GitHub Profile
const _ = require('lodash');
const createEvent = require('aws-event-mocks');
const expect = require('expect');
const yaml = require('js-yaml');
const fs = require('fs');
const dotenv = require('dotenv');
const diff = require('deep-diff');
const fns = {};
/**
@siwalikm
siwalikm / aes-256-cbc.js
Last active May 24, 2024 16:55
AES-256-CBC implementation in nodeJS with built-in Crypto library
'use strict';
const crypto = require('crypto');
const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key
const IV = "5183666c72eec9e4"; // set random initialisation vector
// ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex');
const phrase = "who let the dogs out";
var encrypt = ((val) => {
@JacobHsu
JacobHsu / postjson.js
Created November 6, 2014 09:05
#nodejs #npm - post json with node.js (npm request )
var request = require('request');
var options = {
uri: 'https://www.googleapis.com/urlshortener/v1/url',
method: 'POST',
json: {
"longUrl": "http://www.google.com/"
}
};