export function BitChecker(initial: number = 0, length: number = 32): boolean[] & { value: number } {
	const target: boolean[] = new Array(length).fill(false).map((x, i) => {
		return (initial & (1 << i)) !== 0 ? true : false
	});
	return new Proxy(target, {
		get(target, property) {
			if (property == "value") {
				return target.reduce((a, b, i) => a + (b ? 2 ** i : 0), 0);
			}

			return Reflect.get(target, property);
		},

		set(target, property, value) {
			return Reflect.set(target, property, value);
		}
	}) as (boolean[] & { value: number })
}