Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 935B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <input type="file" id="input">
  2. <output id="output"></output>
  3. <style>
  4. output::before {
  5. content: "output:";
  6. }
  7. output {
  8. display: block;
  9. padding: 1em;
  10. margin: 1em;
  11. outline: 1px solid gray;
  12. white-space: pre-wrap;
  13. }
  14. </style>
  15. <script src="../dist/md5.min.js"></script>
  16. <script>
  17. function readAsArrayBuffer(file){
  18. return new Promise(function(resolve) {
  19. var reader = new FileReader();
  20. reader.readAsArrayBuffer(file)
  21. reader.onload = function(e) {
  22. resolve(e.target.result)
  23. };
  24. });
  25. }
  26. input.onchange = function(e) {
  27. var file = input.files[0];
  28. readAsArrayBuffer(file)
  29. .then(buffer => {
  30. console.log(buffer);
  31. var now = performance.now();
  32. var hash = MD5(buffer);
  33. var after = performance.now() - now;
  34. output.innerHTML = `
  35. file: ${file.name}
  36. size: ${file.size} bytes
  37. type: ${file.type}
  38. md5: ${hash}
  39. duration: ${after.toFixed(2)} ms
  40. `;
  41. })
  42. }
  43. </script>