A Pen by A Non Ymous on CodePen.
Created
September 9, 2013 21:22
-
-
Save anonymous/6501698 to your computer and use it in GitHub Desktop.
A Pen by A Non Ymous.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="cc" style="display:none"></canvas><img id="imag"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cc = $('#cc').get(0).getContext('2d'),img=$('img#imag'); | |
function captcha() | |
{ | |
var text = ""; | |
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for( var i=0; i < 5; i++ ) | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
return text; | |
} | |
cc.beginPath(); | |
Math.min(parseInt(Math.random()*100)) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
Math.min(parseInt(Math.random()*100)) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
Math.min(parseInt(Math.random()*100)) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
Math.min(parseInt(Math.random()*100)) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.moveTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))); | |
cc.lineTo(Math.min(parseInt(Math.random()*100)),Math.max(parseInt(Math.random()*100))) | |
cc.stroke() | |
var pulaae=captcha(); | |
cc.font = "40px Segoe UI" | |
cc.fillText(pulaae,10,50); | |
img.attr('src',cc.canvas.toDataURL()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment