ALT Linux Bugzilla
– Attachment 17387 Details for
Bug 50992
SIGABRT при вызове ed25519_create_seed()
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
Тестовый пример
main.cpp (text/x-c++src), 887 bytes, created by
Юрий Бобылев
on 2024-12-13 21:40:51 MSK
(
hide
)
Description:
Тестовый пример
Filename:
MIME Type:
Creator:
Юрий Бобылев
Created:
2024-12-13 21:40:51 MSK
Size:
887 bytes
patch
obsolete
>#include <cstring> >#include <iostream> >#include <libtorrent/kademlia/ed25519.hpp> >#include <sstream> > >std::string >to_hex(const std::array<char, 32> &key) >{ > std::string result; > result.resize(key.size() * 2); > size_t count = 0; > std::locale loc("C"); > std::for_each(key.begin(), key.end(), [&result, &count, loc](auto &el) { > uint8_t val8; > std::memcpy(&val8, &el, sizeof(el)); > std::stringstream strm; > strm.imbue(loc); > strm << std::hex << static_cast<int>(val8); > if(val8 <= 15) > { > result[count] = '0'; > result[count + 1] = strm.str()[0]; > } > else > { > result[count] = strm.str()[0]; > result[count + 1] = strm.str()[1]; > } > count += 2; > }); > return result; >} > >int >main() >{ > std::array<char, 32> seed = lt::dht::ed25519_create_seed(); > > std::cout << "Seed: " << to_hex(seed) << std::endl; > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 50992
: 17387