<commit_before>/* 
==================================================================================================
  Core - JavaScript Foundation
  Copyright 2013 <NAME>
==================================================================================================
*/

"use strict";


(function() {
	var Random = core.util.Random;
	var ArrayType = "Uint8Array" in window ? Uint8Array : Array;
	
	var hexTable = new Array(256);
	for (var i=0; i<256; i++) {
		if (i < 16) {
			hexTable[i] = "0" + i.toString(16);
		} else {
			hexTable[i] = i.toString(16);
		}
	}
	
	var getArrayOfBytes = function() {
		var uuid = new ArrayType(16);
		for (var i=0; i<16; i++) {
			if (i==6) {
				uuid[i] = 64 + (Random.getByte() & 0x0F); // 4 << 4 + RANDOM : First 4 bits representing version number (=4)
			} else if (i==8) {
				uuid[i] = (((Random.getByte() & 0x0F)&0x3|0x8) << 4) + (Random.getByte() & 0x0F); // Random byte with first two bits set to 10
			} else {
				uuid[i] = Random.getByte();
			}
		}
		return uuid;
	};<commit_msg>Fix Uint8Array detection in nodeJS (no window object)<commit_after>/* 
==================================================================================================
  Core - JavaScript Foundation
  Copyright 2013 <NAME>
==================================================================================================
*/

"use strict";


(function() {
	var Random = core.util.Random;
	var ArrayType = typeof(Uint8Array) == "function" ? Uint8Array : Array;
	
	var hexTable = new Array(256);
	for (var i=0; i<256; i++) {
		if (i < 16) {
			hexTable[i] = "0" + i.toString(16);
		} else {
			hexTable[i] = i.toString(16);
		}
	}
	
	var getArrayOfBytes = function() {
		var uuid = new ArrayType(16);
		for (var i=0; i<16; i++) {
			if (i==6) {
				uuid[i] = 64 + (Random.getByte() & 0x0F); // 4 << 4 + RANDOM : First 4 bits representing version number (=4)
			} else if (i==8) {
				uuid[i] = (((Random.getByte() & 0x0F)&0x3|0x8) << 4) + (Random.getByte() & 0x0F); // Random byte with first two bits set to 10
			} else {
				uuid[i] = Random.getByte();
			}
		}
		return uuid;
	};
{'fraction_non_alphanumeric': 0.3339640491958373, 'fraction_numerical': 0.04399243140964995, 'mean_word_length': 3.8958333333333335, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 5, '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': '5604994', 'n_tokens_mistral': 825, 'n_tokens_neox': 689, 'n_words': 184}