b-encode operations