This file contains 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
/** | |
* @fileoverview Various function argument and object constructor examples | |
* @author Joey Whelan | |
*/ | |
//base example | |
function example1(p1,p2,p3) { | |
console.log('example1'); | |
const params = { |
This file contains 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
/*jshint esversion: 6 */ | |
'use strict'; | |
'use esversion 6'; | |
const MongoClient = require('mongodb').MongoClient; | |
const CONNECTION_URL = 'mongodb://admin:mongo@localhost:27017'; | |
const DB_NAME = 'testDB'; | |
const COLLECTION = 'testCollection'; |
This file contains 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 crypto = require('crypto'); | |
var mongodb = require('mongodb'); | |
var Binary = require('mongodb').Binary; | |
var userColl = undefined; | |
var saltLengthBytes = 64; | |
var hashIterations = 10000; | |
var keyLengthBytes = 64; | |
function authenticateUser(id, password, callback) |
This file contains 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
/** | |
* Joey Whelan | |
* 3 examples on usage of the node crypto module | |
*/ | |
var crypto = require('crypto'); | |
var plainText = '1234567812345678'; | |
try | |
{ |
This file contains 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 timeStamper = function() | |
{ | |
var date = new Date(); | |
var sec = date.getSeconds(); | |
if (sec < 10) | |
sec = '0' + sec; | |
var min = date.getMinutes(); | |
if (min < 10) | |
min = '0' + min; |