Skip to content

Instantly share code, notes, and snippets.

View kierdavis's full-sized avatar

Kier Davis kierdavis

View GitHub Profile
hashcat (v3.10) starting in benchmark-mode...
OpenCL Platform #1: NVIDIA Corporation
======================================
- Device #1: GeForce GTX 1060 6GB, 1517/6069 MB allocatable, 10MCU
Hashtype: MD4
Speed.Dev.#1.: 19674.9 MH/s (96.43ms)
@kierdavis
kierdavis / countbits32bench.nim
Created September 5, 2016 12:32
Benchmark for countBits32
import nimbench
from math import countBits32
bench(countBits32, m):
var x = 0
for i in 1..m:
x += countBits32(int32(i))
doNotOptimizeAway(x)
runBenchmarks()
@kierdavis
kierdavis / countbitsbench.nim
Created September 5, 2016 02:31
Benchmark for math.countBits using nimbench
import nimbench
from math import countBits
bench(countBits8, m):
var x = 0
for i in 1..m:
x += countBits(uint8(i))
doNotOptimizeAway(x)
bench(countBits16, m):
GateKind = enum
gateNot
gateAnd
gateOr
gateNand
gateNor
gateXor
proc raiseValue[T](e: ref Exception): T =
raise e
GateKind = enum
gateNot
gateAnd
gateOr
gateNand
gateNor
gateXor
let kind =
case kindStr
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define ITERATIONS 1000000
uint16_t get_password_hash(const char *password, int password_len) {
register uint16_t hash = 0;
register int char_index = password_len;
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define ITERATIONS 10000000
uint16_t get_password_hash(const char *password, int password_len) {
register uint16_t hash = 0;
register int char_index = password_len;
; IO port constants
.define IO_GPOUT0 0
.define IO_GPOUT1 1
.define IO_GPOUT2 2
.define IO_CTRL 3
.define IO_GPIN0 4
.define IO_SS0 4
.define IO_GPIN1 5
.define IO_SS1 5
.define IO_GPIN2 6
==> Making package: fritzing 0.9.3b-1 (Mon 4 Jul 14:27:28 BST 2016)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading 0.9.3b.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 129 0 129 0 0 253 0 --:--:-- --:--:-- --:--:-- 253
100 12.5M 100 12.5M 0 0 894k 0 0:00:14 0:00:14 --:--:-- 936k
-> Downloading 667a5360e53e8951e5ca6c952ae928f7077a9d5e.tar.gz...
typedef struct {
int a;
char *b;
uint8_t c;
} mystruct;
void call_and_unpack(int *a, char **b, uint8_t *c) {
mystruct s = myfunction();
*a = s.a;
*b = s.b;