c++ - Pack arbitrary number of bits -
what way of packing arbitrary number of bits? have sentences known contain characters , want encrypt. hence option use fewer bits represent these characters , encrypt characters in process.
i looked @ std::bitset, requires me specify size of bitset constant, not do.
i know how packed bits can converted characters obscure output.
ie if pack 1000 , b 0100, resultant 8 bits of packing 1000 0100 character.
btw, not supposed strong form of encryption @ all
what looking dynamic_bitset
. std::bitset
can change size dynamically.
also, can use std::vector<bool>
need side effect of unfortunate historical decision implement bitset.
hope helps. luck!
Comments
Post a Comment