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
/* | |
wordArray: { words: [..], sigBytes: words.length * 4 } | |
*/ | |
// assumes wordArray is Big-Endian (because it comes from CryptoJS which is all BE) | |
// From: https://gist.github.com/creationix/07856504cf4d5cede5f9#file-encode-js | |
function convertWordArrayToUint8Array(wordArray) { | |
var len = wordArray.words.length, | |
u8_array = new Uint8Array(len << 2), | |
offset = 0, word, i |
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
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
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
# Jordan Orelli wrote it. | |
# Do what you want with it. | |
# June 9th, 2011 | |
import os | |
import subprocess | |
import tempfile | |
if not os.environ.has_key('EDITOR'): | |
raise Exception('Unable to open editor; please set your EDITOR ' |
NewerOlder