Skip to content

Instantly share code, notes, and snippets.

# -*- Mode: Python -*-
# OpenSSL wrapper
# https://github.com/joric/brutus/blob/master/ecdsa_ssl.py
import ctypes
import ctypes.util
ssl = ctypes.cdll.LoadLibrary (ctypes.util.find_library ('ssl') or 'libeay32')

SIGHASH_ALL

This is the default. It indicates that everything about the transaction is signed, except for the input scripts. Signing the input scripts as well would obviously make it impossible to construct a transaction, so they are always blanked out. Note, though, that other properties of the input, like the connected output and sequence numbers, are signed; it's only the scripts that are not. Intuitively, it means "I agree to put my money in, if everyone puts their money in and the outputs are this".

SIGHASH_NONE

The outputs are not signed and can be anything. Use this to indicate "I agree to put my money in, as long as everyone puts their money in, but I don't care what's done with the output". This mode allows others to update the transaction by changing their inputs sequence numbers.

SIGHASH_SINGLE

Like SIGHASH_NONE, the inputs are signed, but the sequence numbers are blanked, so others can create new versions of the transaction. However, the only output that is signed is the one at the s

Date: 2013-07-15
Description: (1) <dooglus> lost 1300 BTC
23:38:37 (34725) <florence> no new name
23:38:37 (20153) <unknown> flory. please don't gamble with any of doogs money, and if anyone here is up in investment consider donating to doog
23:38:59 (2458) <usagi> I gave money away when I was up
23:39:02 (34458) <florence> so doog did a charity, and let flory gamble with free 1300 btc
23:39:03 (1601) <willphase> if flory pays it back then he's still up, and doog doesn't take a huge hit
23:39:05 (34458) <florence> is that what happened today ?
23:39:17 (34725) <florence> guys
<?php
ini_set('memory_limit', '256M');
function bet_lucky_number($server_seed_str, $client_seed_str, $client_nonce) {
$str = $server_seed_str . $client_seed_str . '-' . $client_nonce;
// $h = hash('SHA256', hash('SHA256', $str));
$h = hash('SHA512', hash('SHA512', $str));
// $h = hash('SHA512', $str);
// $h = hash('SHA256', $str);
// $h = 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';
//---------------------------------------------------------------------
// 暴雪MPQ hash函数
//---------------------------------------------------------------------
/* 使用前要先调用函数prepareCryptTable()初始化编码表。 */
DWORD cryptTable[0x500]; /* 编码表 */
void prepareCryptTable() {
DWORD seed = 0x00100001, index1 = 0, index2 = 0, i;
for( index1 = 0; index1<0x100; index1++ ) {
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <sys/resource.h>
/* Saved resource information for the beginning of an operation */
static struct rusage sBegin;
/*
** Begin timing an operation
@bitkevin
bitkevin / log2.c
Last active December 20, 2015 03:08
// ---------------------------------------------------------------------
// 来自lua源码,移植性好
int luaO_log2 (unsigned int x) {
static const lu_byte log_2[256] = {
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
package main
import (
"flag"
"fmt"
"io"
"log"
"net"
"os"
"time"
#! /bin/bash
#
# @see <http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in>
#
DIR=$(cd $(dirname "$0"); pwd)
echo $DIR