rewrite array_insert_unique function to operate on bytes