Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ブースト ランダム ジェネレーターを使用してランダム UUID を生成しています。現在生成しているランダム UUID はかなり長くなっています。
私が今使っているコード行は
std::string strAK = to_string( boost::uuids::random_generator()() );
このコードを変更して、2 桁の UUID を生成する方法。
些細なことですが、
std::string strAK = to_string( boost::uuids::random_generator()() ).substr( 0, 2 );
しかし、すでにコメントされているように、これは普遍的にユニークではありません.