Skip to content

Commit 811b40b

Browse files
committed
CREDENTIAL: Use robohash for icons.
1 parent 9fab0a7 commit 811b40b

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

demos/credential-management/script.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -153,26 +153,5 @@ document.querySelector('form').addEventListener('submit', function (e) {
153153
});
154154

155155
function getFace(string) {
156-
var hashString = function() {
157-
var hash = 0, i, chr, len;
158-
if (string.length == 0) return hash;
159-
for (i = 0, len = string.length; i < len; i++) {
160-
chr = string.charCodeAt(i);
161-
hash = ((hash << 5) - hash) + chr;
162-
hash |= 0; // Convert to 32bit integer
163-
}
164-
return hash;
165-
};
166-
167-
// Faces from uifaces.com. Thanks!
168-
var faces = [
169-
"https://s3.amazonaws.com/uifaces/faces/twitter/jsa/128.jpg",
170-
"https://s3.amazonaws.com/uifaces/faces/twitter/sauro/128.jpg",
171-
"https://s3.amazonaws.com/uifaces/faces/twitter/brad_frost/128.jpg",
172-
"https://s3.amazonaws.com/uifaces/faces/twitter/rem/128.jpg",
173-
"https://s3.amazonaws.com/uifaces/faces/twitter/pixeliris/128.jpg",
174-
"https://s3.amazonaws.com/uifaces/faces/twitter/csswizardry/128.jpg",
175-
];
176-
177-
return faces[hashString(string) % faces.length];
156+
return "https://robohash.org/" + string + "?set=set3";
178157
}

0 commit comments

Comments
 (0)