-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
68 lines (66 loc) · 1.74 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RIPEMD-160 Hash Converter Demo</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f7f7f7;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
text-align: center;
background-color: #fff;
padding: 50px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
input {
padding: 10px;
margin: 10px 0;
width: 300px;
border: 1px solid #ddd;
border-radius: 5px;
}
input[type='text']:focus {
outline: none;
border-color: #007bff;
}
.hash-output {
font-weight: bold;
color: #007bff;
}
</style>
</head>
<body>
<div class="container">
<h1>RIPEMD-160 Hash Converter</h1>
<input type="text" id="inputHex" placeholder="Enter hex string" />
<input
type="text"
id="outputHash"
placeholder="RIPEMD-160 hash"
readonly
/>
<p class="hash-output"></p>
</div>
<script type="module">
import ripemd160 from './index.js'
document
.getElementById('inputHex')
.addEventListener('keyup', function () {
var hex = this.value
var hash = ripemd160(hex) // Replace this call with your actual RIPEMD-160 hashing function
document.getElementById('outputHash').value = hash
document.querySelector('.hash-output').textContent = hash
})
</script>
</body>
</html>