use crate::{Encoding, Integer};
use core::ops::Add;
use hybrid_array::{Array, ArraySize, typenum::Unsigned};
pub type ByteArray<T> = Array<u8, <T as ArrayEncoding>::ByteSize>;
pub trait ArrayEncoding: Encoding {
type ByteSize: ArraySize + Add + Eq + Ord + Unsigned;
fn from_be_byte_array(bytes: ByteArray<Self>) -> Self;
fn from_le_byte_array(bytes: ByteArray<Self>) -> Self;
fn to_be_byte_array(&self) -> ByteArray<Self>;
fn to_le_byte_array(&self) -> ByteArray<Self>;
}
pub trait ArrayDecoding {
type Output: ArrayEncoding + Integer;
fn into_uint_be(self) -> Self::Output;
fn into_uint_le(self) -> Self::Output;
}