It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
bool addrToHash160(
uint8_t *hash160,
const uint8_t *addr,
bool checkHash,
bool verbose
) {
static BIGNUM *sum = 0;
static BN_CTX *ctx = 0;
if(unlikely(!ctx)) {
ctx = BN_CTX_new();
BN_CTX_init(ctx);
sum = BN_new();
}
BN_zero(sum);
while(1) {
uint8_t c = *(addr++);
if(unlikely(0==c)) break;
uint8_t dg = fromB58Digit(c);
BN_mul_word(sum, 58);
BN_add_word(sum, dg);
}
uint8_t buf[4 + 2 + kRIPEMD160ByteSize + 4];
size_t size = BN_bn2mpi(sum, 0);
if(sizeof(buf)warning(
"BN_bn2mpi returned weird buffer size %d, expected %d\n",
(int)size,
(int)sizeof(buf)
);
return false;
}
BN_bn2mpi(sum, buf);
uint32_t recordedSize =
(buf[0]<<24) |
(buf[1]<<16) |
(buf[2]<< 8) |
(buf[3]<< 0)
;
if(size!=(4+recordedSize)) {
warning(
"BN_bn2mpi returned bignum size %d, expected %d\n",
(int)recordedSize,
(int)size-4
);
return false;
}
uint8_t *bigNumEnd;
uint8_t *dataEnd = size + buf;
uint8_t *bigNumStart = 4 + buf;
uint8_t *checkSumStart = bigNumEnd = (-4 + dataEnd);
while(0==bigNumStart[0] && bigNumStart
ptrdiff_t bigNumSize = bigNumEnd - bigNumStart;
ptrdiff_t padSize = kRIPEMD160ByteSize - bigNumSize;
if(0if(0 memcpy(padSize + hash160, bigNumStart, bigNumSize);
}
memset(hash160, 0, padSize);
} else {
memcpy(hash160, bigNumStart - padSize, kRIPEMD160ByteSize);
}
bool hashOK = true;
if(checkHash) {
uint8_t data[1+kRIPEMD160ByteSize];
memcpy(1+data, hash160, kRIPEMD160ByteSize);
data[0] = getCoinType();
uint8_t sha[kSHA256ByteSize];
sha256Twice(sha, data, 1+kRIPEMD160ByteSize);
hashOK =
sha[0]==checkSumStart[0] &&
sha[1]==checkSumStart[1] &&
sha[2]==checkSumStart[2] &&
sha[3]==checkSumStart[3];
if(!hashOK) {
warning(
"checksum of address %s failed. Expected 0x%x%x%x%x, got 0x%x%x%x%x.",
addr,
checkSumStart[0],
checkSumStart[1],
checkSumStart[2],
checkSumStart[3],
sha[0],
sha[1],
sha[2],
sha[3]
);
}
}
return hashOK;
}