Root-Boolean Dual Node Inteligic — a verifiable dual-node consensus decision structure
Project description
Root-Boolean
Some hash-like utilities for binary vector operations. Built on a decision structure with two independent nodes.
Quick install
pip install ceflobhash
What's in the box
from root_boolean import (
binarize, # float → binary vector
hamming_distance, # binary vector distance
)
A couple of hash-adjacent tools. Nothing groundbreaking.
Examples
1. Quick embedding search (LLM optimization snippet)
from root_boolean import binarize, hamming_distance
import numpy as np
# Simulate a small embedding cache
cache = {
"dog": np.random.randn(768),
"cat": np.random.randn(768),
"car": np.random.randn(768),
}
query = np.random.randn(768)
# Binarize everything
q_hm = binarize(query, bits=256)
results = []
for word, vec in cache.items():
v_hm = binarize(vec, bits=256)
d = hamming_distance(q_hm, v_hm)
results.append((d, word))
results.sort()
# → nearest neighbor by Hamming, no dot product needed
2. Conway's Game of Life (state cell demo)
from root_boolean import binarize
# Encode a 5x5 Game of Life board as a binary vector
board = [
[0,1,0,0,0],
[0,0,1,0,0],
[1,1,1,0,0],
[0,0,0,0,0],
[0,0,0,0,0],
]
flat = [cell for row in board for cell in row]
# Pad to 64 bits and hash
vec = binarize(flat, bits=64)
# → can be used as a "board fingerprint" for state comparison
3. Dual node check (the part nobody asked for)
from root_boolean import DualNode
node = DualNode(
anchor_a=([1,0,1,0], (1,0,0,0), 3.0),
anchor_b=([0,1,0,1], (0,1,0,0), 3.0),
)
v = node.evaluate(([1,0,1,0], (1,0,0,0)))
# → "TRUE" | "FALSE" | "UNKNOWN"
h = node.audit(([1,0,1,0], (1,0,0,0)), v)
# → SHA-256 fingerprint
Status
v0.1.0 — casual release. Issues and comments welcome.
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ceflobhash-0.1.1.tar.gz.
File metadata
- Download URL: ceflobhash-0.1.1.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba3bd1d148b96d353779d9b28fb9adb9a25b40fe7e4dd5a98c43231f877eadf1
|
|
| MD5 |
471006a1c6a82b65873a3237aaa0595e
|
|
| BLAKE2b-256 |
a7a5d677d6e8df51b09ca5eaa28722b38fbb6fdaa0cf19a0287b36a5547fa570
|
File details
Details for the file ceflobhash-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ceflobhash-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1008098c3e7cc4308401585c860f1f42848d4582667b6ed5d4feae10d50accef
|
|
| MD5 |
8cc767ed511966729f89f80b0a3e80d4
|
|
| BLAKE2b-256 |
40a757f5b3b43d8aea2e490effb0a01903a6d9a9aa00658fc30200fa62ad3340
|