<commit_before>var querystring = require('querystring');
var http = require('http');
var fs = require('fs');
var crypto = require('crypto');

function getResult(options, callback) {
    options = options || {};
    
    var dlkbps = options.download || 200000;
    var pingms = options.ping ||  40;;
    var ulkbps = options.upload || 200000;
    var srv = options.server || 5056;

    if (!options.noRandomize) {
        dlkbps = randomize(dlkbps);
        pingms = randomize(pingms);
        ulkbps = randomize(ulkbps);
    }
    
    function hash(parameters, algorithm, seperator) {
        seperator = seperator || "-";
        algorithm = algorithm || "md5"; 
        var str = parameters.join(seperator);
        var shasum = crypto.createHash(algorithm);
        shasum.update(encodeURIComponent(str));
        return shasum.digest('hex');
    }

    function randomize(number) {
        return Math.floor(number * (0.8 + 0.2 * Math.random()));
    }
    
    function parse(res) {
        var i, tempArr, tempArr2, id, resObj;
        res = res.toString();
        tempArr = res.split('&');<commit_msg>Revert "change randomize range to 0.8~1"<commit_after>var querystring = require('querystring');
var http = require('http');
var fs = require('fs');
var crypto = require('crypto');

function getResult(options, callback) {
    options = options || {};
    
    var dlkbps = options.download || 200000;
    var pingms = options.ping ||  40;;
    var ulkbps = options.upload || 200000;
    var srv = options.server || 5056;

    if (!options.noRandomize) {
        dlkbps = randomize(dlkbps);
        pingms = randomize(pingms);
        ulkbps = randomize(ulkbps);
    }
    
    function hash(parameters, algorithm, seperator) {
        seperator = seperator || "-";
        algorithm = algorithm || "md5"; 
        var str = parameters.join(seperator);
        var shasum = crypto.createHash(algorithm);
        shasum.update(encodeURIComponent(str));
        return shasum.digest('hex');
    }

    function randomize(number) {
        return Math.floor(number * (0.9 + 0.2 * Math.random()));
    }
    
    function parse(res) {
        var i, tempArr, tempArr2, id, resObj;
        res = res.toString();
        tempArr = res.split('&');
{'fraction_non_alphanumeric': 0.14050689195197866, 'fraction_numerical': 0.02267674522009782, 'mean_word_length': 2.6704730831973897, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6365162', 'n_tokens_mistral': 740, 'n_tokens_neox': 696, 'n_words': 160}