Skip to content

Commit bbc4c9a

Browse files
authored
Update README.md
1 parent 2f289cd commit bbc4c9a

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ print(hasher.hash("Hello, World!")) # Example usage
5757
```
5858

5959
### **Output**
60-
```3F2A9D7B89C4E6A5D12F1E4B67A3C9D5E8F7B2A6C3D1E0F4B6A2D9C7E3F5A8B1```
60+
```
61+
3F2A9D7B89C4E6A5D12F1E4B67A3C9D5E8F7B2A6C3D1E0F4B6A2D9C7E3F5A8B1
62+
```
6163

6264
## ⚙️ How It Works
6365

@@ -69,7 +71,49 @@ print(hasher.hash("Hello, World!")) # Example usage
6971

7072
## 🔬 Benchmarking (Coming Soon)
7173

72-
HashX is being tested against **SHA-256, BLAKE3, xxHash, and MurmurHash3** for speed and efficiency.
74+
# 📊 HashX Benchmarking Report
75+
76+
This document compares **HashX** with other popular hashing algorithms: **SHA-256, BLAKE3, and MurmurHash3**.
77+
The benchmark measures **speed (MB/s)**, **collision resistance**, and **avalanche effect**.
78+
79+
## 🔬 Benchmarking Script (Python)
80+
81+
Run the following script to test HashX performance:
82+
83+
```python
84+
import time
85+
import hashlib
86+
import blake3
87+
import mmh3
88+
from hashx import HashX
89+
90+
# Test Data (10MB)
91+
data = b"A" * (10 * 1024 * 1024)
92+
93+
def benchmark_hashing(algorithm, func):
94+
start = time.time()
95+
func(data)
96+
end = time.time()
97+
speed = (len(data) / (end - start)) / (1024 * 1024) # MB/s
98+
return speed
99+
100+
# Hashing functions
101+
hashx = HashX()
102+
tests = {
103+
"HashX": lambda d: hashx.hash(d),
104+
"SHA-256": lambda d: hashlib.sha256(d).hexdigest(),
105+
"BLAKE3": lambda d: blake3.blake3(d).hexdigest(),
106+
"MurmurHash3": lambda d: mmh3.hash_bytes(d)
107+
}
108+
109+
# Run Benchmark
110+
results = {name: benchmark_hashing(name, func) for name, func in tests.items()}
111+
112+
# Print Results
113+
print("\n📊 Benchmark Results:")
114+
for name, speed in results.items():
115+
print(f"{name}: {speed:.2f} MB/s")
116+
```
73117

74118
## 🛠️ Future Plans
75119

0 commit comments

Comments
 (0)