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
0 | |
#103 bad length: iciF0y | |
#366 bad length: oAtify4 | |
#764 bad length: 3diFy | |
#823 bad length: i4fy | |
1000 | |
#1311 bad length: ci0fy | |
#1601 bad length: e6uSify | |
#1628 bad length: Tun0ify | |
#1786 bad length: tif3y |
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() { | |
var ps = {}; | |
for (var i = 0; i < 1000000; i++) { | |
var p = GPW.pronounceable(7); | |
if (p.length != 8) { | |
console.log("#"+i+" bad length: ", p); | |
} | |
if (ps[p]) { | |
console.log("#"+i+" collission!", p); |
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 getRandomBytes(length) { | |
var bytes = new Uint8Array(length); | |
window.crypto.getRandomValues(bytes); | |
return bytes; | |
} | |
function generatePassword(length) { | |
// To avoid modulo bias, alphabet length must conform to 256 % length == 0, e.g. 64. | |
var alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@'.split(''); | |
var bytes = getRandomBytes(length); |
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
Problem: | |
Peak electricity consumption leads to downtime. | |
The majority of people don't want such downtime. | |
Proposed solution: | |
Switching to compact fluorescent lamp will reduce peak consumption. | |
Ways to implement solution: |
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> | |
// https://github.com/dchest/tweetnacl-js/issues/12 | |
var gf = function() { return [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; }; | |
var D2 = [61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]; | |
function car25519(o) { | |
var c; | |
for (var i = 0; i < 16; i++) { | |
o[i] += 65536; |
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
--- tweetnacl-20131229.c 2013-12-29 12:06:54.000000000 +0100 | |
+++ tweetnacl-20140427.c 2014-04-27 11:17:16.000000000 +0200 | |
@@ -22,7 +22,7 @@ | |
Y = {0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666}, | |
I = {0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83}; | |
-static u32 L32(u32 x,int c) { return (x << c) | (x >> (32 - c)); } | |
+static u32 L32(u32 x,int c) { return (x << c) | ((x&0xffffffff) >> (32 - c)); } | |
static u32 ld32(const u8 *x) |
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
package main | |
import ( | |
"fmt" | |
"crypto/rand" | |
"code.google.com/p/go.crypto/nacl/box" | |
"code.google.com/p/go.crypto/curve25519" | |
) | |
func main() { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="[add your bin description]" /> | |
<script src="//fb.me/react-0.10.0.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
Downloading/unpacking deadlock | |
Downloading deadlock-0.1.1.tar.gz | |
Running setup.py (path:/tmp/pip_build_root/deadlock/setup.py) egg_info for package deadlock | |
Traceback (most recent call last): | |
File "<string>", line 17, in <module> | |
File "/tmp/pip_build_root/deadlock/setup.py", line 1, in <module> | |
import deadlock | |
ImportError: No module named deadlock | |
Complete output from command python setup.py egg_info: | |
Traceback (most recent call last): |
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
// Written by Dmitry Chestnykh. Public domain. | |
// Package uuid provides Universally unique identifiers. | |
package uuid | |
import ( | |
"crypto/rand" | |
"fmt" | |
"io" | |
) |
OlderNewer