Merge pull request #341 from macedigital/fix-identicon-hash-size

Fix: Truncate key-length when generating identicons
This commit is contained in:
Martin Zimmermann 2017-08-17 11:27:59 +02:00 committed by GitHub
commit 650c6cf126

View File

@ -47,7 +47,7 @@ define(["app/lib/promise", "app/config"], function(Q, config) {
} }
Q.when(key, function(key) { Q.when(key, function(key) {
var hash = pad((parseInt(key, 16) % Math.pow(2, 18)).toString(2), 18), var hash = pad((parseInt(key.substr(-16), 16) % Math.pow(2, 18)).toString(2), 18),
index = 0; index = 0;
svg.setAttribute("data-hash", key); svg.setAttribute("data-hash", key);