<commit_before>var io 	=	require('socket.io')(80);
var fs	=	require('fs');
var crypto	=	require('crypto');

var MAX_CONCURRENT_FILES	=	10;
var MAX_FILESIZE	=	5E7;	//50 Mb
var MAX_CHUNKSIZE	=	4E3;	//4	Kb
var CLEARING_ID;

var FILES_DIR	=	'/public/files/';


io.on('connection',function(socket){
	
	socket.on('msg');
	socket.on('img');
	
	socket.on('chunk',function(data){
		var file	=	global.files[data.token];
		//Don't wanna get a file that doesn't eist
		if(file	==	undefined)
			return res.send('[TOKEN_INVALID]');
		
		//Whoa, this chunk is wayy too big.
		if(data.chunk.length>file.chunkSize)
			return res.send('[CHUNK_TOO_BIG]');
		
		//Add the chunk to the file
		fs.appendFileSync(file.location,atob(data.chunk));
		
		//Make sure it's not too big.
		var stats	=	fs.fstatSync(fs.openSync(file.location,'a'));
		
		if(stats.size>file.fileSize){
			//too big, so might as well get rid of it.
			fs.unlink(file.location,function(){
				delete file;
			});
			return res.send('[FILE_TOO_BIG]');
		}
		if(stats.size===file.fileSize){
			//Build a handler for the file.
		}<commit_msg>Making a new better thing<commit_after>var io 	=	require('socket.io')(80);
var fs	=	require('fs');
var crypto	=	require('crypto');

var MAX_CONCURRENT_FILES	=	10;
var MAX_FILESIZE	=	5E7;	//50 Mb
var MAX_CHUNKSIZE	=	4E3;	//4	Kb
var CLEARING_ID;

var FILES_DIR	=	'/public/files/';

var users	=	{
	
	
	
}


io.on('connection',function(socket){
	
	socket.on('msg',function(data){
		if()
		
		io.sockets.emit('msg',{
		
		});
	});
	socket.on('img');
	
	socket.on('chunk',function(data){
		var file	=	global.files[data.token];
		//Don't wanna get a file that doesn't eist
		if(file	==	undefined)
			return res.send('[TOKEN_INVALID]');
		
		//Whoa, this chunk is wayy too big.
		if(data.chunk.length>file.chunkSize)
			return res.send('[CHUNK_TOO_BIG]');
		
		//Add the chunk to the file
		fs.appendFileSync(file.location,atob(data.chunk));
		
		//Make sure it's not too big.
		var stats	=	fs.fstatSync(fs.openSync(file.location,'a'));
		
		if(stats.size>file.fileSize){
			//too big, so might as well get rid of it.
			fs.unlink(file.location,function(){
				delete file;
			});
			return res.send('[FILE_TOO_BIG]');
		}
		if(stats.size===file.fileSize){
			//Build a handler for the file.
		}
{'fraction_non_alphanumeric': 0.16615384615384615, 'fraction_numerical': 0.00967032967032967, 'mean_word_length': 3.588709677419355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5405640', 'n_tokens_mistral': 1001, 'n_tokens_neox': 876, 'n_words': 200}