<commit_before>var bcrypt = require('bcrypt');


module.exports.validateUsername = function(username) {
  return !!/^[a-zA-Z][a-zA-Z0-9._-]*$/.exec(username);
};

module.exports.validateEmailAddress = function(emailAddress) {
  return !!/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/.exec(emailAddress);
};

module.exports.validatePassword = function(password) {
  return !!/^.{6,}$/.exec(password);
};

var userKey = 'user';

module.exports.get = function(db, username, callback) {
  db.get(userKey, callback);
};

module.exports.create = function(db, userData, callback) {
  console.log('creating in ', userData, JSON.stringify(db));
  db.set(userKey, userData, function(err) {
    if (err) {
      callback(err);
    } else {
      callback();
    }
  });
<commit_msg>remove debug<commit_after>var bcrypt = require('bcrypt');


module.exports.validateUsername = function(username) {
  return !!/^[a-zA-Z][a-zA-Z0-9._-]*$/.exec(username);
};

module.exports.validateEmailAddress = function(emailAddress) {
  return !!/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/.exec(emailAddress);
};

module.exports.validatePassword = function(password) {
  return !!/^.{6,}$/.exec(password);
};

var userKey = 'user';

module.exports.get = function(db, username, callback) {
  db.get(userKey, callback);
};

module.exports.create = function(db, userData, callback) {
  db.set(userKey, userData, function(err) {
    if (err) {
      callback(err);
    } else {
      callback();
    }
  });

{'fraction_non_alphanumeric': 0.21619812583668005, 'fraction_numerical': 0.012048192771084338, 'mean_word_length': 3.933993399339934, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7439645', 'n_tokens_mistral': 565, 'n_tokens_neox': 548, 'n_words': 77}