JavaScript 아이덴티콘

1 개요[ | ]

JavaScript identicon
JavaScript 아이덴티콘
<canvas id='c'></canvas>
<script src="//cdnjs.cloudflare.com/ajax/libs/blueimp-md5/2.12.0/js/md5.min.js"></script>
<script>
m = md5('Hello')
F = '#'+m.substr(26,6);
E = '#0000';
s = 20;
ctx = document.getElementById('c').getContext('2d');
f = Array(5).fill();
a = f.map((_,i)=>f.map((_,j)=>parseInt(m[i*3+j],16)/6|0));
a.map((b,x)=>b.map((v,y)=>{
	ctx.fillStyle = y>=3?b[y==3?1:0]?F:E:b[y]?F:E;ctx.fillRect(y*s,x*s,s,s)
}));
</script>

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}