MCPcopy Create free account
hub / github.com/c3d/tao3D / IsolatedInitialize

Method IsolatedInitialize

libcryptopp/cryptopp/basecode.cpp:13–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11NAMESPACE_BEGIN(CryptoPP)
12
13void BaseN_Encoder::IsolatedInitialize(const NameValuePairs &parameters)
14{
15 parameters.GetRequiredParameter("BaseN_Encoder", Name::EncodingLookupArray(), m_alphabet);
16
17 parameters.GetRequiredIntParameter("BaseN_Encoder", Name::Log2Base(), m_bitsPerChar);
18 if (m_bitsPerChar <= 0 || m_bitsPerChar >= 8)
19 throw InvalidArgument("BaseN_Encoder: Log2Base must be between 1 and 7 inclusive");
20
21 byte padding;
22 bool pad;
23 if (parameters.GetValue(Name::PaddingByte(), padding))
24 pad = parameters.GetValueWithDefault(Name::Pad(), true);
25 else
26 pad = false;
27 m_padding = pad ? padding : -1;
28
29 m_bytePos = m_bitPos = 0;
30
31 int i = 8;
32 while (i%m_bitsPerChar != 0)
33 i += 8;
34 m_outputBlockSize = i/m_bitsPerChar;
35
36 m_outBuf.New(m_outputBlockSize);
37}
38
39size_t BaseN_Encoder::Put2(const byte *begin, size_t length, int messageEnd, bool blocking)
40{

Callers

nothing calls this directly

Calls 5

GetValueMethod · 0.80
NewMethod · 0.80
AssignMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected