<commit_before>#include <time.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "utils.h"
#include "base64.h"
#include "hmac.h"

char *getIsoDate() {
  time_t rawtime;
  time(&rawtime);
  struct tm *timeinfo;
  timeinfo = gmtime (&rawtime);
  char *date = (char *)malloc(64);
  date[0]=0;
	strftime(date, 1024, "%a, %d %b %Y %H:%M:%S GMT", timeinfo);
	return date;
}

char *hrSize(uint64_t size) {
	char *result = malloc(400);
	if (size>=1024*1024*1024) { // gigabyte
		sprintf(result, "%.3fGb", (double)size / 1024 / 1024 / 1024);
	} else if (size>=1024*1024) { // megabyte
		sprintf(result, "%.2fMb", (double)size / 1024 / 1024);
	} else if (size>=1024) { // kilobyte
		sprintf(result, "%.2fKb", (double)size / 1024);
	} else { 
		sprintf(result, "%hub", (uint16_t) size);
	}
	return result;
}

char *guessContentType(char *filename) {
	char *dotPos = strrchr(filename, '.');
	if (dotPos==NULL) {
		return (char *)"application/octet-stream";
	}

	dotPos++;
	char *lowcaseExtension = (char *) malloc(strlen(filename));<commit_msg>oops :)<commit_after>#include <time.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "utils.h"
#include "base64.h"
#include "hmac.h"

char *getIsoDate() {
  time_t rawtime;
  time(&rawtime);
  struct tm *timeinfo;
  timeinfo = gmtime (&rawtime);
  char *date = (char *)malloc(64);
  date[0]=0;
	strftime(date, 1024, "%a, %d %b %Y %H:%M:%S GMT", timeinfo);
	return date;
}

char *hrSize(uint64_t size) {
	char *result = malloc(400);
	if (size>=1024*1024*1024) { // gigabyte
		sprintf(result, "%.3fGb", (double)size / 1024 / 1024 / 1024);
	} else if (size>=1024*1024) { // megabyte
		sprintf(result, "%.2fMb", (double)size / 1024 / 1024);
	} else if (size>=1024) { // kilobyte
		sprintf(result, "%.2fKb", (double)size / 1024);
	} else { 
		sprintf(result, "%hub", (uint16_t) size);
	}
	return result;
}

char *guessContentType(char *filename) {
	char *dotPos = strrchr(filename, '.');
	if (dotPos==NULL) {
		return (char *)"application/octet-stream";
	}

	dotPos++;
	char *lowcaseExtension = (char *) malloc(strlen(filename));
	lowcaseExtension[0]=0;
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.06388888888888888, 'mean_word_length': 4.4847715736040605, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '5120702', 'n_tokens_mistral': 993, 'n_tokens_neox': 872, 'n_words': 197}