Boost

C++ boostを使用してSHA-1 ハッシュ値の計算 メモ

C++ Boost.Uuidのdetailにあるsha1クラスを用いてSHA-1 ハッシュ値を計算する方法のメモです。 SHA-1の場合ハッシュ値は20バイト固定なのでboost::array<boost::uint8_t,20>を返すような関数を作りました。main.cpp #include <boost/uuid/sha1.hpp> #include <boost/cstdint.hpp> #include <boost/array.hpp> #include <iostream> typedef boost::arr</iostream></boost/array.hpp></boost/cstdint.hpp></boost/uuid/sha1.hpp></boost::uint8_t,20>…

C++ 双方向マップ boost::bimaps 覚え書き

双方向のからアクセス可能なmapとしてboost::bimapsがあります。 今回はそのboost::bimapsの覚え書きです。 まずは単純な1対1の双方向mapとして使う場合 #include <string> #include <iostream> #include <boost/bimap/bimap.hpp> int main() { // int : string の1対1のmap typedef boost::bimaps::bi</boost/bimap/bimap.hpp></iostream></string>…