let from_string s =
let n = String.length s in
let v = create n false in
for i = 0 to n - 1 do
let c = String.unsafe_get s i in
if c = '1' then
unsafe_set v i true
else
if c <> '0' then invalid_arg "Bitv.from_string"
done;
v