<commit_before>﻿using System;
using System.Text;

namespace Confuser.Runtime {
	internal static class Constant {
		static byte[] b;

		static void Initialize() {
			var l = (uint)Mutation.KeyI0;
			uint[] q = Mutation.Placeholder(new uint[Mutation.KeyI0]);

			var k = new uint[0x10];
			var n = (uint)Mutation.KeyI1;
			for (int i = 0; i < 0x10; i++) {
				n ^= n >> 12;
				n ^= n << 25;
				n ^= n >> 27;
				k[i] = n;
			}

			int s = 0, d = 0;
			var w = new uint[0x10];
			var o = new byte[l * 4];
			while (s < l) {
				for (int j = 0; j < 0x10; j++)
					w[j] = q[s + j];
				Mutation.Crypt(w, k);
				for (int j = 0; j < 0x10; j++) {
					uint e = w[j];
					o[d++] = (byte)e;
					o[d++] = (byte)(e >> 8);
					o[d++] = (byte)(e >> 16);
					o[d++] = (byte)(e >> 24);
					k[j] ^= e;
				}
				s += 0x10;
			}

			b = Lzma.Decompress(o);
		}

		static T Get<T>(uint id) {
			id = (uint)Mutation.Placeholder((int)id);
			uint t = id >> 30;

			T ret = default(T);
			id &= 0x3fffffff;
			id <<= 2;

			if (t == Mutation.KeyI0) {
				int l = b[id++] | (b[id++] << 8) | (b[id++] << 16) | (b[id++] << 24);
				ret = (T)(object)string.Intern(Encoding.UTF8.GetString(b, (int)id, l));
			}
			// NOTE: Assume little-endian
			else if (t == Mutation.KeyI1) {
				var v = new T[1];
				Buffer.BlockCopy(b, (int)id, v, 0, Mutation.Value<int>());
				ret = v[0];
			}<commit_msg>Update Constant.cs<commit_after>﻿using System;
using System.Text;

namespace Confuser.Runtime {
	internal static class Constant {
		static byte[] b;

		static void Initialize() {
			var l = (uint)Mutation.KeyI0;
			uint[] q = Mutation.Placeholder(new uint[Mutation.KeyI0]);

			var k = new uint[0x10];
			var n = (uint)Mutation.KeyI1;
			for (int i = 0; i < 0x10; i++) {
				n ^= n >> 8;
				n ^= n << 21;
				n ^= n >> 32;
				k[i] = n;
			}

			int s = 0, d = 0;
			var w = new uint[0x10];
			var o = new byte[l * 4];
			while (s < l) {
				for (int j = 0; j < 0x10; j++)
					w[j] = q[s + j];
				Mutation.Crypt(w, k);
				for (int j = 0; j < 0x10; j++) {
					uint e = w[j];
					o[d++] = (byte)e;
					o[d++] = (byte)(e >> 9);
					o[d++] = (byte)(e >> 18);
					o[d++] = (byte)(e >> 27);
					k[j] ^= e;
				}
				s += 0x10;
			}

			b = Lzma.Decompress(o);
		}

		static T Get<T>(uint id) {
			id = (uint)Mutation.Placeholder((int)id);
			uint t = id >> 30;

			T ret = default(T);
			id &= 0x3fffffff;
			id <<= 2;

			if (t == Mutation.KeyI0) {
				int l = b[id++] | (b[id++] << 8) | (b[id++] << 16) | (b[id++] << 24);
				ret = (T)(object)string.Intern(Encoding.UTF8.GetString(b, (int)id, l));
			}
			// NOTE: Assume little-endian
			else if (t == Mutation.KeyI1) {
				var v = new T[1];
				Buffer.BlockCopy(b, (int)id, v, 0, Mutation.Value<int>());
				ret = v[0];
			}
{'fraction_non_alphanumeric': 0.21702898550724636, 'fraction_numerical': 0.03876811594202899, 'mean_word_length': 2.2986857825567504, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6483512', 'n_tokens_mistral': 1513, 'n_tokens_neox': 1188, 'n_words': 311}