package main | |
import ( | |
"io" | |
"mime/multipart" | |
"net/http" | |
"net/url" | |
"os" | |
"fmt" | |
) |
See also, http://libraryofalexandria.io/cgo/
cgo
has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src
. IDE's(vim) Goto command not works.
So, Here collect materials.
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <stdbool.h> | |
#include <time.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#include "future.h" |
Chainsaw fetches a block with tipset bafy2bzaceaxd64ic4e36kbkn3apxdbjkknrdar7kozc552pd55aurowy5kocs
and block height 4684
. One of the messages in this block represents an addAsk
method. The param passed to this method chokes up when it gets decoded https://github.com/openworklabs/filecoin-network-stats/blob/master/backend/src/client/ABI.ts#L68.
Essentially the param passed in the message gets “chunked” into 2 buffers, the second of which appears to be an empty buffer, which goes on to get decoded by the BigIntDecoder https://github.com/openworklabs/filecoin-network-stats/blob/master/backend/src/client/ABI.ts#L22. The BigIntDecoder attempts to decode the empty buffer, but returns “NaN” instead. This causes the message to become malformed, it looks like this:
{
height: 4684,
tipsetHash:
'bafy2bzaceaxd64ic4e36kbkn3apxdbjkknrdar7kozc552pd55aurowy5kocs',
index: 2,
// Model to represent an account in the distributed database | |
// Accounts are mainly a place users can store information like their private keys, in a password protected | |
// vault, so they can login conveniently from other devices and keep hold of their private keys and record | |
// what blogs they are authors of. It's also a way for other users to lookup an authors public keys to validate | |
// their other objects when determining if a new version of some data really belongs to the blog it claims to be | |
// related to. | |
const nacl = require('tweetnacl') | |
const cbor = require('borc') | |
class HSAccount { |
The AVR series microcontrollers are a collection of cheap and versatile chips that are used in many applications ranging from hobbist projects to commercial infrastructure. One major problem for some hobbists is the lack of secure random number generation on the Arduino platform. The included pseudo-random number generator (PRNG) is very easy to defeat and is useless for any crypto-related uses. One recommendation from the Arduino Reference Manual is to use atmospheric noise from the chip's analog sensor pins as seed data[6].
Unfortunately this method is extremely weak and should not be used to emulate a true random number generator (TRNG). Existing methods such as using the internal timer drift or using a dedicated generator are either too slow, requires extensive external hardware or modifications to the microcontroller's internal mech
package main | |
// mentioned in bleve google group | |
// https://groups.google.com/forum/#!topic/bleve/-5Q6W3oBizY | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/blevesearch/bleve" | |
"github.com/blevesearch/bleve/document" |
// Playbook - http://play.golang.org/p/3wFl4lacjX | |
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" |