bpak_utils — BPAK utils

This documents the BPAK utils functions


Source code: include/bpak/utils.h, lib/utils.c


BPAK - Bit Packer

Copyright (C) 2022 Jonas Blixt jonpe960@gmail.com

SPDX-License-Identifier: BSD-3-Clause

BPAK - Bit Packer

Copyright (C) 2019 Jonas Blixt jonpe960@gmail.com

SPDX-License-Identifier: BSD-3-Clause

Functions

int bpak_bin2hex(uint8_t *data, size_t data_sz, char *buf, size_t buf_sz)

Converts a binary array to a hex string

Parameters:
  • data[in] Data to convert

  • data_sz[in] Size of input data in bytes

  • buf[out] Output buffer

  • buf_sz[in] Size of output buffer in bytes

Returns:

BPAK_OK on success

int bpak_uuid_to_string(const uint8_t *data, char *buf, size_t size)
int bpak_meta_to_string(struct bpak_header *h, struct bpak_meta_header *m, char *buf, size_t size)
bpak_id_t bpak_part_name_to_hash_tree_id(const char *part_name)
bpak_id_t bpak_part_id_to_hash_tree_id(bpak_id_t part_id)
bpak_id_t bpak_hash_tree_id_to_part_id(struct bpak_header *header, bpak_id_t part_id)