MCPcopy Create free account
hub / github.com/LUX-Core/lux / putOut

Function putOut

src/cpp-ethereum/rlp/main.cpp:181–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179};
180
181void putOut(bytes _out, Encoding _encoding, bool _encrypt, bool _quiet)
182{
183 dev::h256 h = dev::sha3(_out);
184 if (_encrypt)
185 crypto::Secp256k1PP::get()->encrypt(toPublic(Secret(h)), _out);
186 if (!_quiet)
187 cerr << "Keccak of RLP: " << h.hex() << endl;
188
189 switch (_encoding)
190 {
191 case Encoding::Hex: case Encoding::Auto:
192 cout << toHex(_out) << endl;
193 break;
194 case Encoding::Base64:
195 cout << toBase64(&_out) << endl;
196 break;
197 case Encoding::Binary:
198 cout.write((char const*)_out.data(), _out.size());
199 break;
200 case Encoding::Keccak:
201 cout << sha3(_out).hex() << endl;
202 break;
203 }
204}
205
206int main(int argc, char** argv)
207{

Callers 1

mainFunction · 0.85

Calls 7

toHexFunction · 0.85
hexMethod · 0.80
sha3Function · 0.50
encryptMethod · 0.45
writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected