Spaces:
Sleeping
Sleeping
Update Web/hash.html
Browse files- Web/hash.html +95 -97
Web/hash.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<meta
|
| 6 |
<title>Hash Id Generator</title>
|
| 7 |
<style>
|
| 8 |
* {
|
|
@@ -21,6 +21,7 @@
|
|
| 21 |
flex-direction: column;
|
| 22 |
background: #f6f0f0;
|
| 23 |
color: #1a1a1a;
|
|
|
|
| 24 |
}
|
| 25 |
|
| 26 |
/* ---------- HEADER ---------- */
|
|
@@ -38,16 +39,17 @@
|
|
| 38 |
color: #ffffff;
|
| 39 |
}
|
| 40 |
|
| 41 |
-
header nav a:hover {
|
| 42 |
-
|
| 43 |
-
}
|
| 44 |
|
|
|
|
| 45 |
.container {
|
| 46 |
max-width: 750px;
|
| 47 |
margin: 40px auto;
|
| 48 |
text-align: center;
|
| 49 |
-
padding: 40px;
|
| 50 |
-
flex: 1;
|
| 51 |
}
|
| 52 |
|
| 53 |
h1 {
|
|
@@ -113,6 +115,8 @@ header nav a:hover {
|
|
| 113 |
background: #202020;
|
| 114 |
padding: 30px;
|
| 115 |
color: #ffffff;
|
|
|
|
|
|
|
| 116 |
}
|
| 117 |
.footer-content {
|
| 118 |
display: grid;
|
|
@@ -170,114 +174,108 @@ header nav a:hover {
|
|
| 170 |
<div class="result" id="resultText">Hash: –</div>
|
| 171 |
|
| 172 |
<div class="extra-info">
|
| 173 |
-
This tool computes a precise SHA-256 hash, uniquely fingerprinting files to detect any modification, ensuring absolute integrity—essential for developers, cybersecurity professionals, and anyone requiring reliable file authenticity verification.
|
| 174 |
</div>
|
| 175 |
</div>
|
| 176 |
|
| 177 |
-
|
| 178 |
-
<footer>
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
<
|
| 184 |
-
</
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
<
|
| 190 |
-
</
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
<
|
| 196 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
</div>
|
| 198 |
-
<div class="
|
| 199 |
-
<
|
| 200 |
-
<span>Miss. Shraddha Gadekar
|
| 201 |
-
<h5>Model Design & Tool Development</h5>
|
| 202 |
-
</span>
|
| 203 |
</div>
|
| 204 |
-
</
|
| 205 |
-
<div class="contact">
|
| 206 |
-
Contact us: <a href="https://mail.google.com/mail/?view=cm&to=spectroguard.security@gmail.com&su=SpectroGuard%20Inquiry" target="_blank" style="color: #1877F2;">spectroguard.security@gmail.com</a>
|
| 207 |
-
</div>
|
| 208 |
-
</footer>
|
| 209 |
|
| 210 |
<script>
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
let frozen = false;
|
| 215 |
-
let lastCheckedFile = null;
|
| 216 |
-
|
| 217 |
-
// Show frozen hint when user selects a new file while frozen
|
| 218 |
-
fileInput.addEventListener("change", () => {
|
| 219 |
-
if (frozen && fileInput.files[0] !== lastCheckedFile) {
|
| 220 |
-
result.textContent = "New file selected — click Generate Hash to update.";
|
| 221 |
-
result.style.color = "#888";
|
| 222 |
-
}
|
| 223 |
-
});
|
| 224 |
-
|
| 225 |
-
// Enter key triggers hash
|
| 226 |
-
fileInput.addEventListener("keydown", (e) => {
|
| 227 |
-
if (e.key === "Enter") {
|
| 228 |
-
e.preventDefault(); // ← blocks file browser from opening
|
| 229 |
-
generateHash();
|
| 230 |
-
}
|
| 231 |
-
});
|
| 232 |
|
| 233 |
-
|
|
|
|
| 234 |
|
| 235 |
-
|
| 236 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
|
|
|
|
|
|
| 242 |
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
result.style.color = "#888";
|
| 246 |
|
| 247 |
-
|
| 248 |
-
|
|
|
|
|
|
|
| 249 |
|
| 250 |
-
|
| 251 |
-
|
|
|
|
| 252 |
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
frozen = true;
|
| 256 |
-
}
|
| 257 |
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
const total = finalHash.length;
|
| 261 |
-
let revealed = 0;
|
| 262 |
|
| 263 |
-
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
}
|
| 273 |
-
|
| 274 |
-
result.textContent = display;
|
| 275 |
-
|
| 276 |
-
revealed++;
|
| 277 |
-
if (revealed > total) clearInterval(interval);
|
| 278 |
-
}, 35);
|
| 279 |
-
}
|
| 280 |
-
</script>
|
| 281 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 282 |
</body>
|
| 283 |
-
</html>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Hash Id Generator</title>
|
| 7 |
<style>
|
| 8 |
* {
|
|
|
|
| 21 |
flex-direction: column;
|
| 22 |
background: #f6f0f0;
|
| 23 |
color: #1a1a1a;
|
| 24 |
+
min-height: 100vh; /* Ensures layout context fills viewport */
|
| 25 |
}
|
| 26 |
|
| 27 |
/* ---------- HEADER ---------- */
|
|
|
|
| 39 |
color: #ffffff;
|
| 40 |
}
|
| 41 |
|
| 42 |
+
header nav a:hover {
|
| 43 |
+
color: #000;
|
| 44 |
+
}
|
| 45 |
|
| 46 |
+
/* ---------- CONTAINER ---------- */
|
| 47 |
.container {
|
| 48 |
max-width: 750px;
|
| 49 |
margin: 40px auto;
|
| 50 |
text-align: center;
|
| 51 |
+
padding: 40px 20px;
|
| 52 |
+
flex: 1 0 auto; /* 🛠️ FIX: Forces wrapper to grow dynamically, anchoring footer to bottom */
|
| 53 |
}
|
| 54 |
|
| 55 |
h1 {
|
|
|
|
| 115 |
background: #202020;
|
| 116 |
padding: 30px;
|
| 117 |
color: #ffffff;
|
| 118 |
+
width: 100%;
|
| 119 |
+
margin-top: auto; /* 🛠️ FIX: Safety margin configuration anchor */
|
| 120 |
}
|
| 121 |
.footer-content {
|
| 122 |
display: grid;
|
|
|
|
| 174 |
<div class="result" id="resultText">Hash: –</div>
|
| 175 |
|
| 176 |
<div class="extra-info">
|
| 177 |
+
This tool computes a precise SHA-256 hash, uniquely fingerprinting files to detect any modification, ensuring absolute integrity—essential for developers, cybersecurity professionals, and anyone requiring reliable file authenticity verification.
|
| 178 |
</div>
|
| 179 |
</div>
|
| 180 |
|
| 181 |
+
<footer>
|
| 182 |
+
<div class="footer-content">
|
| 183 |
+
<div class="footer-item">
|
| 184 |
+
<img src="/static/Sir.jpg" alt="Prof. Swapnil Chaudhari">
|
| 185 |
+
<span>Prof. Swapnil Chaudhari
|
| 186 |
+
<h5>Guide and Instructor</h5>
|
| 187 |
+
</span>
|
| 188 |
+
</div>
|
| 189 |
+
<div class="footer-item">
|
| 190 |
+
<img src="/static/Pratiksha.jpg" alt="Pratiksha Alhat">
|
| 191 |
+
<span>Miss. Pratiksha Alhat
|
| 192 |
+
<h5>Connectivity, Training & Testing</h5>
|
| 193 |
+
</span>
|
| 194 |
+
</div>
|
| 195 |
+
<div class="footer-item">
|
| 196 |
+
<img src="/static/Kapil.jpg" alt="Kapil Waghumbare">
|
| 197 |
+
<span>Mr. Kapil Waghumbare
|
| 198 |
+
<h5>UI/UX, Model Design & Tool Development</h5>
|
| 199 |
+
</span>
|
| 200 |
+
</div>
|
| 201 |
+
<div class="footer-item">
|
| 202 |
+
<img src="/static/Shraddha.jpg" alt="Shraddha Gadekar">
|
| 203 |
+
<span>Miss. Shraddha Gadekar
|
| 204 |
+
<h5>Model Design & Tool Development</h5>
|
| 205 |
+
</span>
|
| 206 |
+
</div>
|
| 207 |
</div>
|
| 208 |
+
<div class="contact">
|
| 209 |
+
Contact us: <a href="https://mail.google.com/mail/?view=cm&to=spectroguard.security@gmail.com&su=SpectroGuard%20Inquiry" target="_blank" style="color: #1877F2;">spectroguard.security@gmail.com</a>
|
|
|
|
|
|
|
|
|
|
| 210 |
</div>
|
| 211 |
+
</footer>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
|
| 213 |
<script>
|
| 214 |
+
const fileInput = document.getElementById("fileInput");
|
| 215 |
+
const result = document.getElementById("resultText");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
|
| 217 |
+
let frozen = false;
|
| 218 |
+
let lastCheckedFile = null;
|
| 219 |
|
| 220 |
+
fileInput.addEventListener("change", () => {
|
| 221 |
+
if (frozen && fileInput.files[0] !== lastCheckedFile) {
|
| 222 |
+
result.textContent = "New file selected — click Generate Hash to update.";
|
| 223 |
+
result.style.color = "#888";
|
| 224 |
+
}
|
| 225 |
+
});
|
| 226 |
|
| 227 |
+
fileInput.addEventListener("keydown", (e) => {
|
| 228 |
+
if (e.key === "Enter") {
|
| 229 |
+
e.preventDefault();
|
| 230 |
+
generateHash();
|
| 231 |
+
}
|
| 232 |
+
});
|
| 233 |
|
| 234 |
+
async function generateHash() {
|
| 235 |
+
const file = fileInput.files[0];
|
|
|
|
| 236 |
|
| 237 |
+
if (!file) {
|
| 238 |
+
result.textContent = "Hash: No file selected";
|
| 239 |
+
return;
|
| 240 |
+
}
|
| 241 |
|
| 242 |
+
frozen = false;
|
| 243 |
+
result.textContent = "Hash: Processing...";
|
| 244 |
+
result.style.color = "#888";
|
| 245 |
|
| 246 |
+
const arrayBuffer = await file.arrayBuffer();
|
| 247 |
+
const hashBuffer = await crypto.subtle.digest("SHA-256", arrayBuffer);
|
|
|
|
|
|
|
| 248 |
|
| 249 |
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
| 250 |
+
const hashHex = hashArray.map(b => b.toString(16).padStart(2, "0")).join("");
|
|
|
|
|
|
|
| 251 |
|
| 252 |
+
animateHash(hashHex);
|
| 253 |
+
lastCheckedFile = file;
|
| 254 |
+
frozen = true;
|
| 255 |
+
}
|
| 256 |
|
| 257 |
+
function animateHash(finalHash) {
|
| 258 |
+
const chars = "0123456789abcdef";
|
| 259 |
+
const total = finalHash.length;
|
| 260 |
+
let revealed = 0;
|
| 261 |
+
|
| 262 |
+
result.style.color = "#1a1a1a";
|
| 263 |
+
|
| 264 |
+
const interval = setInterval(() => {
|
| 265 |
+
let display = "Hash: ";
|
| 266 |
+
for (let i = 0; i < total; i++) {
|
| 267 |
+
if (i < revealed) {
|
| 268 |
+
display += finalHash[i];
|
| 269 |
+
} else {
|
| 270 |
+
display += chars[Math.floor(Math.random() * chars.length)];
|
| 271 |
+
}
|
| 272 |
}
|
| 273 |
+
result.textContent = display;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
|
| 275 |
+
revealed++;
|
| 276 |
+
if (revealed > total) clearInterval(interval);
|
| 277 |
+
}, 35);
|
| 278 |
+
}
|
| 279 |
+
</script>
|
| 280 |
</body>
|
| 281 |
+
</html>
|