This file contains 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
/*************** | |
Comes from a SO comment | |
@Josh K: This is a little over-the-top: $hash = sha1(sha1($password) ^ $salt);, $hash = sha1($password.$salt); would work just as well in practice (and faster). Also, the only reason I can think of to sha1(microtime()) is to constrain it to something that can fit in your column, and substr(str(microtime()), 0, 160) would work equally well (and faster), although I doubt microtime() gives a > 160 digit number anyway. Of course, you might be intentionally making it slow (so it would take more time to crack), but the performance should at least be mentioned. | |
Question: http://stackoverflow.com/questions/3038136/am-i-supposed-to-store-hashes-for-passwords/3038182#3038182 | |
User: http://stackoverflow.com/users/212555/brendan-long | |
**************/ |
This file contains 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
boolean excepted = false; | |
while(!excepted && (/* Condition */)) | |
{ | |
try | |
{ | |
/* Amazing code */ | |
} | |
catch(Exception e) | |
{ |
This file contains 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 ws = new WebSocket("ws://localhost:40132"); | |
ws.onopen = function() | |
{ | |
output("Opened connection."); | |
}; | |
ws.onmessage = function(e) | |
{ | |
date = new Date(e.data); | |
if(isNaN(date.getHours())) | |
{ |
This file contains 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
function output(str) | |
{ | |
document.getElementById("log").innerHTML = str; | |
} |
This file contains 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
</script> | |
</head> | |
<body> | |
<div id="log"></div> | |
</body> | |
</html> |
This file contains 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 net = require("net"), | |
domains = ["*:*"]; |
This file contains 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
net.createServer( | |
function(socket) | |
{ | |
/** | |
* Start the flash policy file | |
*/ | |
socket.write("<?xml version=\"1.0\"?>"); | |
socket.write("<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">\n"); | |
socket.write("<cross-domain-policy>\n"); | |
This file contains 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
sudo node flashpolicy.js > flashpolicy.log & sleep 5; tail flashpolicy.log |
This file contains 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 sys = require("sys"), | |
ws = require('./lib/ws'); | |
var server = ws.createServer(); | |
intervals = {}; | |
server.addListener("listening", | |
function() | |
{ | |
sys.log("Listening for connections."); |
This file contains 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
// Handle WebSocket Requests | |
server.addListener("connection", | |
function(conn) | |
{ | |
conn.send("Connection: "+conn.id); | |
sys.log("Connection found: " + conn.id); |
OlderNewer