Changeset View
Changeset View
Standalone View
Standalone View
src/uint256.h
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* 160-bit opaque blob. | * 160-bit opaque blob. | ||||
* @note This type is called uint160 for historical reasons only. It is an | * @note This type is called uint160 for historical reasons only. It is an | ||||
* opaque blob of 160 bits and has no integer operations. | * opaque blob of 160 bits and has no integer operations. | ||||
*/ | */ | ||||
class uint160 : public base_blob<160> { | class uint160 : public base_blob<160> { | ||||
public: | public: | ||||
uint160() {} | uint160() {} | ||||
explicit uint160(const base_blob<160> &b) : base_blob<160>(b) {} | |||||
explicit uint160(const std::vector<uint8_t> &vch) : base_blob<160>(vch) {} | explicit uint160(const std::vector<uint8_t> &vch) : base_blob<160>(vch) {} | ||||
}; | }; | ||||
/** | /** | ||||
* 256-bit opaque blob. | * 256-bit opaque blob. | ||||
* @note This type is called uint256 for historical reasons only. It is an | * @note This type is called uint256 for historical reasons only. It is an | ||||
* opaque blob of 256 bits and has no integer operations. Use arith_uint256 if | * opaque blob of 256 bits and has no integer operations. Use arith_uint256 if | ||||
* those are required. | * those are required. | ||||
*/ | */ | ||||
class uint256 : public base_blob<256> { | class uint256 : public base_blob<256> { | ||||
public: | public: | ||||
uint256() {} | uint256() {} | ||||
explicit uint256(const base_blob<256> &b) : base_blob<256>(b) {} | |||||
explicit uint256(const std::vector<uint8_t> &vch) : base_blob<256>(vch) {} | explicit uint256(const std::vector<uint8_t> &vch) : base_blob<256>(vch) {} | ||||
/** | /** | ||||
* A cheap hash function that just returns 64 bits from the result, it can | * A cheap hash function that just returns 64 bits from the result, it can | ||||
* be used when the contents are considered uniformly random. It is not | * be used when the contents are considered uniformly random. It is not | ||||
* appropriate when the value can easily be influenced from outside as e.g. | * appropriate when the value can easily be influenced from outside as e.g. | ||||
* a network adversary could provide values to trigger worst-case behavior. | * a network adversary could provide values to trigger worst-case behavior. | ||||
*/ | */ | ||||
Show All 38 Lines |