Program 7
Program 7
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON and Crypto Example</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
h2 { color: #333; }
</style>
</head>
<body>
<div>
<h3>CSV to JSON:</h3>
<p id="csvToJson"></p>
</div>
<script>
// Sample JSON string
const jsonString = '{"name": "John", "age": 30, "dateOfBirth": "1994-01-01"}';
// d) Create hash from string (using a simple hash function for demo)
function simpleHash(str) {
let hash = 0;
for (let i = 0; i < str.length; i++) {
hash += str.charCodeAt(i);
}
return hash.toString();
}
</script>
</body>
</html>``````````````````````````````````````````````````````````````````