MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / DecodeBase64ToBuf

Method DecodeBase64ToBuf

src/common/crypto_textencode.cpp:554–562  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

552
553//-----------------------------------------------------------------------------
554bool CCrypto::DecodeBase64ToBuf( const char *pszEncoded, uint32 cbEncoded, CUtlBuffer &buf )
555{
556 uint32 cubDecodeSize = cbEncoded * 3 / 4 + 1;
557 buf.EnsureCapacity( cubDecodeSize );
558 if ( !CCrypto::Base64Decode( pszEncoded, cbEncoded, (uint8*)buf.Base(), &cubDecodeSize ) )
559 return false;
560 buf.SeekPut( CUtlBuffer::SEEK_HEAD, cubDecodeSize );
561 return true;
562}
563
564//-----------------------------------------------------------------------------
565bool CCrypto::DecodePEMBody( const char *pszPem, uint32 cch, CUtlBuffer &buf, const char *pszExpectedType )

Callers

nothing calls this directly

Calls 3

SeekPutMethod · 0.80
EnsureCapacityMethod · 0.45
BaseMethod · 0.45

Tested by

no test coverage detected