mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
A better way to convert between uint160 and uint256 types.
This commit is contained in:
@@ -36,4 +36,18 @@ bool u160ToHuman(uint160& buf, std::string& retStr)
|
||||
{
|
||||
retStr=EncodeBase58(buf.begin(),buf.end());
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
|
||||
uint160 uint256::to160() const
|
||||
{
|
||||
uint160 m;
|
||||
memcpy(&m, this, sizeof(uint160));
|
||||
return m;
|
||||
}
|
||||
|
||||
uint256 uint160::to256() const
|
||||
{
|
||||
uint256 m;
|
||||
memcpy(&m, this, sizeof(this));
|
||||
return m;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user