Remove dependency on MD5 library

This commit is contained in:
Yarmo Mackenbach 2020-07-23 10:43:07 +02:00
parent ca24267e3f
commit 9134a36635
3 changed files with 2 additions and 3 deletions

View file

@ -251,7 +251,8 @@ async function displayProfile(opts) {
// Fill in various data // Fill in various data
document.body.querySelector('#profileName').innerHTML = userData.name; document.body.querySelector('#profileName').innerHTML = userData.name;
document.body.querySelector('#profileAvatar').style = ""; document.body.querySelector('#profileAvatar').style = "";
document.body.querySelector('#profileAvatar').src = `https://www.gravatar.com/avatar/${SparkMD5.hash(userData.email)}?s=128&d=mm`; let profileHash = openpgp.util.str_to_hex(openpgp.util.Uint8Array_to_str(await openpgp.crypto.hash.md5(openpgp.util.str_to_Uint8Array(userData.email))));
document.body.querySelector('#profileAvatar').src = `https://www.gravatar.com/avatar/${profileHash}?s=128&d=mm`;
document.title = `${userData.name} - Keyoxide`; document.title = `${userData.name} - Keyoxide`;
// Generate feedback // Generate feedback

File diff suppressed because one or more lines are too long

View file

@ -39,7 +39,6 @@
</body> </body>
<script src="/assets/openpgp.min.js"></script> <script src="/assets/openpgp.min.js"></script>
<script src="/assets/spark-md5.min.js"></script>
<script src="/assets/qrcode.min.js"></script> <script src="/assets/qrcode.min.js"></script>
<script type="text/javascript" src="/assets/scripts.js" charset="utf-8"></script> <script type="text/javascript" src="/assets/scripts.js" charset="utf-8"></script>
</html> </html>