MCPcopy Create free account
hub / github.com/apache/brpc / Generate

Method Generate

src/brpc/policy/rtmp_protocol.cpp:327–334  ·  view source on GitHub ↗

===== impl. =====

Source from the content-addressed store, hash-verified

325
326// ===== impl. =====
327void KeyBlock::Generate() {
328 _offset_data = butil::fast_rand() & 0xFFFFFFFF;
329 const uint8_t* p = (const uint8_t*)&_offset_data;
330 _offset = ((uint32_t)p[0] + p[1] + p[2] + p[3]) % (SIZE - KEY_SIZE - 4);
331 for (size_t i = 0; i < sizeof(_buf) / 8; ++i) {
332 ((uint64_t*)_buf)[i] = butil::fast_rand();
333 }
334}
335
336void KeyBlock::Load(const void* buf) {
337 // Layout of key (764 bytes)

Callers 3

SendC0C1Function · 0.45
WaitForS0S1Method · 0.45

Calls 6

fast_randFunction · 0.85
digestMethod · 0.80
schemaMethod · 0.80
initializeMethod · 0.80
copy_shared_keyMethod · 0.80
keyMethod · 0.45

Tested by

no test coverage detected