Fabcoin Core  0.16.2
P2P Digital Currency
Namespaces | Enumerations | Functions
CommonJS.h File Reference
#include <string>
#include "FixedHash.h"
#include "CommonData.h"
#include "CommonIO.h"
Include dependency graph for CommonJS.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 dev
 Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Originally by RenĂ© Nyffenegger.
 

Enumerations

enum  dev::OnFailed { dev::OnFailed::InterpretRaw, dev::OnFailed::Empty, dev::OnFailed::Throw }
 

Functions

template<unsigned S>
std::string dev::toJS (FixedHash< S > const &_h)
 
template<unsigned N>
std::string dev::toJS (boost::multiprecision::number< boost::multiprecision::cpp_int_backend< N, N, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> const &_n)
 
std::string dev::toJS (bytes const &_n, std::size_t _padding=0)
 
template<unsigned T>
std::string dev::toJS (SecureFixedHash< T > const &_i)
 
template<typename T >
std::string dev::toJS (T const &_i)
 
bytes dev::jsToBytes (std::string const &_s, OnFailed _f=OnFailed::Empty)
 Convert string to byte array. More...
 
bytes dev::padded (bytes _b, unsigned _l)
 Add '0' on, or remove items from, the front of _b until it is of length _l. More...
 
bytes dev::paddedRight (bytes _b, unsigned _l)
 Add '0' on, or remove items from, the back of _b until it is of length _l. More...
 
bytes dev::unpadded (bytes _s)
 Removing all trailing '0'. Returns empty array if input contains only '0' char. More...
 
bytes dev::unpadLeft (bytes _s)
 Remove all 0 byte on the head of _s. More...
 
string dev::fromRaw (h256 _n)
 Convert h256 into user-readable string (by directly using std::string constructor). If it can't be interpreted as an ASCII string, empty string is returned. More...
 
template<unsigned N>
FixedHash< N > dev::jsToFixed (std::string const &_s)
 
template<unsigned N>
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< N *8, N *8, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > dev::jsToInt (std::string const &_s)
 Convert a string representation of a number to an int String can be a normal decimal number, or a hex prefixed by 0x or 0X, or an octal if prefixed by 0 Returns 0 in case of failure. More...
 
u256 dev::jsToU256 (std::string const &_s)
 
std::string dev::jsToDecimal (std::string const &_s)