<commit_before>/*jshint esversion: 6 */

"use strict";

// application/routes.js

module.exports = function(app, passport, myConnectionPool) {
	const mjml = require('mjml')
	, mjmlUtils = require('mjml-utils')
	, fs = require('fs')
	, appRoot = require('app-root-path')
	, createHash = require('sha.js')
	, emailjs = require('emailjs');
	const bCrypt = require('bcrypt-nodejs');

	var MyRoutes = require('../routes/index.js');
	var routes = new MyRoutes(app, passport, myConnectionPool);
	var reNumber = new RegExp("^([0-9]+)$");
	var reHexstring = new RegExp("^([a-fA-F0-9]+)$");
	var reToken = new RegExp("^([a-fA-F0-9]+)$");

	// Helper functions
	function checkNumber(s) {
		return reNumber.test(s);
	}
	function checkHexstring(s) {
		return reHexstring.test(s);
	}
	function checkToken(s) {
		return reToken.test(s);
	}
	function generateToken() {
	    var buf = new Buffer(16);
	    for (var i = 0; i < buf.length; i++) {
	        buf[i] = Math.floor(Math.random() * 256);
	    }
	    var id = buf.toString('base64');
	    return id;
	}
	function sendmail(email, sHash) {
		var sFilepath = __dirname + '/../mailrun/forgot.html';
		mjmlUtils.inject(sFilepath, {<commit_msg>token pattern<commit_after>/*jshint esversion: 6 */

"use strict";

// application/routes.js

module.exports = function(app, passport, myConnectionPool) {
	const mjml = require('mjml')
	, mjmlUtils = require('mjml-utils')
	, fs = require('fs')
	, appRoot = require('app-root-path')
	, createHash = require('sha.js')
	, emailjs = require('emailjs');
	const bCrypt = require('bcrypt-nodejs');

	var MyRoutes = require('../routes/index.js');
	var routes = new MyRoutes(app, passport, myConnectionPool);
	var reNumber = new RegExp("^([0-9]+)$");
	var reHexstring = new RegExp("^([a-fA-F0-9]+)$");
	var reToken = new RegExp("^([a-zA-Z0-9]+)==$");

	// Helper functions
	function checkNumber(s) {
		return reNumber.test(s);
	}
	function checkHexstring(s) {
		return reHexstring.test(s);
	}
	function checkToken(s) {
		return reToken.test(s);
	}
	function generateToken() {
	    var buf = new Buffer(16);
	    for (var i = 0; i < buf.length; i++) {
	        buf[i] = Math.floor(Math.random() * 256);
	    }
	    var id = buf.toString('base64');
	    return id;
	}
	function sendmail(email, sHash) {
		var sFilepath = __dirname + '/../mailrun/forgot.html';
		mjmlUtils.inject(sFilepath, {
{'fraction_non_alphanumeric': 0.183206106870229, 'fraction_numerical': 0.01272264631043257, 'mean_word_length': 3.853909465020576, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1317709', 'n_tokens_mistral': 918, 'n_tokens_neox': 868, 'n_words': 181}