SpectroGuard / Web /hash.html
KapilWaghumbare123's picture
Update Web/hash.html
54cabab verified
Raw History Blame Contribute Delete
7.2 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hash Id Generator</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
html, body {
height: 100%;
}
body {
display: flex;
flex-direction: column;
background: #f6f0f0;
color: #1a1a1a;
min-height: 100vh; /* Ensures layout context fills viewport */
}
/* ---------- HEADER ---------- */
header {
background:#272727;
padding: 15px 30px;
display: flex;
justify-content: space-between;
align-items: center;
}
header h2 {
font-size: 28px;
font-weight: 600;
letter-spacing: 1px;
color: #ffffff;
}
header nav a:hover {
color: #000;
}
/* ---------- CONTAINER ---------- */
.container {
max-width: 750px;
margin: 40px auto;
text-align: center;
padding: 40px 20px;
flex: 1 0 auto; /* 🛠️ FIX: Forces wrapper to grow dynamically, anchoring footer to bottom */
}
h1 {
font-size: 42px;
font-weight: 700;
margin-bottom: 18px;
}
p.desc {
font-size: 16px;
color: #555;
margin-bottom: 35px;
}
input[type="file"] {
width: 90%;
padding: 16px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 16px;
outline: none;
transition: 0.2s;
background: #fff;
}
input:focus {
border-color: #888;
}
button {
margin-top: 20px;
padding: 14px 28px;
font-size: 16px;
background: #2d2d2d;
color: white;
border: none;
border-radius: 10px;
cursor: pointer;
transition: 0.25s;
}
button:hover {
background: #000;
}
.result {
margin-top: 28px;
font-size: 20px;
font-weight: 600;
word-wrap: break-word;
}
.extra-info {
margin-top: 40px;
font-size: 15px;
color: #555;
line-height: 1.6;
text-align: left;
}
/* ---------- FOOTER ---------- */
footer {
background: #202020;
padding: 30px;
color: #ffffff;
width: 100%;
margin-top: auto; /* 🛠️ FIX: Safety margin configuration anchor */
}
.footer-content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 20px;
margin-bottom: 20px;
}
.footer-item {
display: flex;
gap: 12px;
align-items: center;
}
.footer-item img {
width: 65px;
height: 65px;
border-radius: 50%;
object-fit: cover;
flex-shrink: 0;
}
.footer-item span {
font-size: 14px;
line-height: 1.5;
}
.footer-item h5 {
font-weight: 400;
font-size: 12px;
color: #aaa;
margin-top: 2px;
}
.contact {
font-weight: 500;
text-align: center;
font-size: 14px;
color: #ccc;
border-top: 1px solid #333;
padding-top: 18px;
}
</style>
</head>
<body>
<header>
<h2>SPECTROGUARD</h2>
</header>
<div class="container">
<h1>Hash Id Generator</h1>
<p class="desc">Upload a file and instantly generate its SHA-256 hash to verify authenticity and detect tampering.</p>
<input id="fileInput" type="file" />
<button onclick="generateHash()">Generate Hash</button>
<div class="result" id="resultText">Hash: –</div>
<div class="extra-info">
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.
</div>
</div>
<footer>
<div class="footer-content">
<div class="footer-item">
<img src="/static/Sir.jpg" alt="Prof. Swapnil Chaudhari">
<span>Prof. Swapnil Chaudhari
<h5>Guide and Instructor</h5>
</span>
</div>
<div class="footer-item">
<img src="/static/Pratiksha.jpg" alt="Pratiksha Alhat">
<span>Miss. Pratiksha Alhat
<h5>Connectivity, Training & Testing</h5>
</span>
</div>
<div class="footer-item">
<img src="/static/Kapil.jpg" alt="Kapil Waghumbare">
<span>Mr. Kapil Waghumbare
<h5>UI/UX, Model Design & Tool Development</h5>
</span>
</div>
<div class="footer-item">
<img src="/static/Shraddha.jpg" alt="Shraddha Gadekar">
<span>Miss. Shraddha Gadekar
<h5>Model Design & Tool Development</h5>
</span>
</div>
</div>
<div class="contact">
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>
</div>
</footer>
<script>
const fileInput = document.getElementById("fileInput");
const result = document.getElementById("resultText");
let frozen = false;
let lastCheckedFile = null;
fileInput.addEventListener("change", () => {
if (frozen && fileInput.files[0] !== lastCheckedFile) {
result.textContent = "New file selected — click Generate Hash to update.";
result.style.color = "#888";
}
});
fileInput.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
e.preventDefault();
generateHash();
}
});
async function generateHash() {
const file = fileInput.files[0];
if (!file) {
result.textContent = "Hash: No file selected";
return;
}
frozen = false;
result.textContent = "Hash: Processing...";
result.style.color = "#888";
const arrayBuffer = await file.arrayBuffer();
const hashBuffer = await crypto.subtle.digest("SHA-256", arrayBuffer);
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray.map(b => b.toString(16).padStart(2, "0")).join("");
animateHash(hashHex);
lastCheckedFile = file;
frozen = true;
}
function animateHash(finalHash) {
const chars = "0123456789abcdef";
const total = finalHash.length;
let revealed = 0;
result.style.color = "#1a1a1a";
const interval = setInterval(() => {
let display = "Hash: ";
for (let i = 0; i < total; i++) {
if (i < revealed) {
display += finalHash[i];
} else {
display += chars[Math.floor(Math.random() * chars.length)];
}
}
result.textContent = display;
revealed++;
if (revealed > total) clearInterval(interval);
}, 35);
}
</script>
</body>
</html>