UNPKG

hash160

Version:
77 lines (69 loc) 1.76 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Hash160 Demo</title> <style> body { background: linear-gradient(135deg, #9d50bb, #6e48aa); background-attachment: fixed; color: #fff; font-family: 'Arial', sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; margin: 0; } .container { background-color: rgba(106, 57, 171, 0.8); padding: 30px; border-radius: 15px; text-align: center; width: 400px; } h1 { color: #fff; font-size: 32px; } label, p { font-size: 18px; margin-bottom: 15px; margin-top: 15px; } input { width: 80%; padding: 12px; font-size: 18px; border: none; border-radius: 5px; margin-top: 10px; } p { color: #ffa07a; font-weight: bold; } </style> </head> <body> <div class="container"> <h1>Hash160 Calculator</h1> <label for="dataInput">Enter data:</label> <input type="text" id="dataInput" oninput="calculateHash()" /> <p id="output"></p> </div> <script type="module"> import hash160 from './index.js' window.calculateHash = async () => { const data = document.getElementById('dataInput').value const hashResult = await hash160(data) document.getElementById( 'output' ).innerText = `Hash160 of "${data}" is: ${hashResult}` } </script> </body> </html>