/* Copyright (c) 2025 Jakub Juszczakiewicz
 * All rights reserved.
 */

#include "xprint.h"
#include <stdio.h>
#include <stdint.h>

void xprint(uint8_t * val, size_t count)
{
#ifdef BIG_ENDIAN
  for (size_t i = 0; i < count; i++) {
    fprintf(stderr, "%02hhX", *val++);
  }
#else
  val += count - 1;

  for (size_t i = 0; i < count; i++) {
    fprintf(stderr, "%02hhX", *val--);
  }
#endif
}
