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

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -