{{ message }}

Instantly share code, notes, and snippets.

# husobee

Created Nov 8, 2018
View lw16.go
 package main import ( "crypto/hmac" "crypto/rand" "crypto/sha1" "fmt" "math/big" )
Created Oct 24, 2018
CLWW16 toy project
View clww16.go
 package main import ( "crypto/hmac" "crypto/sha256" "fmt" ) func main() { fmt.Println("Example CLWW 2016 Implementation")
Created Apr 3, 2018
rwmutex-v-chan
View rwmutexvchan_test.go
 package main import ( "sync" "testing" ) type stuff struct { ret chan string input string
Created Feb 6, 2018
producer-consumer problem with message passing
View producer-consumer-problem1.go
 package main import ( "errors" "fmt" "math/rand" "time" ) func init() {
Created Feb 6, 2018
example producer-consumer problem
View producer-consumer-problem.go
 package main import ( "errors" "fmt" "math/rand" "time" ) func init() {
Created Sep 10, 2017
arith-overflow
View arithmetic.c
 #include int main() { // Given an unsigned char, if we add 1 to the max value an unsigned char can have, // we strangely get the correct value, which should have overflown the char... unsigned char a = 255; printf("%lu + 1 == %d \n", a, a + 1); // Output: 255 + 1 == 256 // When we take this value and assign it to an unsigned char, and look at the
Last active Sep 10, 2017
overflow-underflow-casting
View overunder.c
 #include int main() { // Down Casting an unsigned long to an unsigned char unsigned long a = 257; printf("%lu == %d \n", a, (unsigned char)a); // Output: 257 == 1 // This is obviously not true, but there are not enough bits in a // char (8 bits) to hold 257, so it will carry over the extra into the value
Created Apr 27, 2017
simple linked list implementation