-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
56 lines (42 loc) · 1.43 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<label>File:</label>
<input type="file" id="inputField" />
<button>Submit file</button>
</div>
</body>
<script src="./dist/browser/bundle.js"></script>
<script>
var inputElement = document.getElementById("inputField");
inputElement.addEventListener("change", handleFiles, false);
async function handleFiles() {
var fileList = this.files;
const file = new data.open(fileList[0])
// console.log(file);
// console.log("newww", fileList[0]);
// const rowStream = await file.rows({ size: 20, keyed: true });
// file.descriptor.sample = await toArray(rowStream);
// console.log("rowStream: ", rowStream);
// await file.addSchema();
// console.log("descriptor: ", file);
// // Show the progress of the hash generator on console in devtools
let hash = await file.hash("sha256", (percent) => {
console.log(percent);
})
console.log(hash);
//test if hash is cached
let cachehash = await file.hash("sha256", (percent) => {
console.log(percent);
})
console.log(cachehash);
// console.log("lenght", Buffer.byteLength(contentBuffer));
}
</script>
</html>