mirror of
https://github.com/AskDavis/Casinotest.git
synced 2026-01-05 12:49:47 -08:00
Version 1.1.0.0 update
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2012 The Bitcoin developers
|
||||
// Copyright (c) 2011-2012 Litecoin Developers
|
||||
// Copyright (c) 2013 CasinoCoin Developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef BITCOIN_UINT256_H
|
||||
@@ -10,6 +8,7 @@
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -22,14 +21,14 @@ inline int Testuint256AdHoc(std::vector<std::string> vArg);
|
||||
|
||||
|
||||
/** Base class without constructors for uint256 and uint160.
|
||||
* This makes the compiler let u use it in a union.
|
||||
* This makes the compiler let you use it in a union.
|
||||
*/
|
||||
template<unsigned int BITS>
|
||||
class base_uint
|
||||
{
|
||||
protected:
|
||||
enum { WIDTH=BITS/32 };
|
||||
unsigned int pn[WIDTH];
|
||||
uint32_t pn[WIDTH];
|
||||
public:
|
||||
|
||||
bool operator!() const
|
||||
@@ -57,6 +56,16 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
double getdouble() const
|
||||
{
|
||||
double ret = 0.0;
|
||||
double fact = 1.0;
|
||||
for (int i = 0; i < WIDTH; i++) {
|
||||
ret += fact * pn[i];
|
||||
fact *= 4294967296.0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
base_uint& operator=(uint64 b)
|
||||
{
|
||||
@@ -308,7 +317,7 @@ public:
|
||||
psz += 2;
|
||||
|
||||
// hex string to uint
|
||||
static unsigned char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 };
|
||||
static const unsigned char phexdigit[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0xa,0xb,0xc,0xd,0xe,0xf,0,0,0,0,0,0,0,0,0 };
|
||||
const char* pbegin = psz;
|
||||
while (phexdigit[(unsigned char)*psz] || *psz == '0')
|
||||
psz++;
|
||||
@@ -346,7 +355,17 @@ public:
|
||||
return (unsigned char*)&pn[WIDTH];
|
||||
}
|
||||
|
||||
unsigned int size()
|
||||
const unsigned char* begin() const
|
||||
{
|
||||
return (unsigned char*)&pn[0];
|
||||
}
|
||||
|
||||
const unsigned char* end() const
|
||||
{
|
||||
return (unsigned char*)&pn[WIDTH];
|
||||
}
|
||||
|
||||
unsigned int size() const
|
||||
{
|
||||
return sizeof(pn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user