import { AbstractInt } from "../AbstractInt" ; import { BIT_LENGTH } from "../utils/Bytes" ; /** Representation for a UInt8 value in the system. */ export class UInt8 extends AbstractInt < u8 > { constructor ( value = 0 ) { super ( value , BIT_LENGTH . INT_8 ) ; } description static fromU8a ( value , index = 0 ) { assert ( value . length - index > 0 , "Uint8: cannot decode invalid u8 encoded value" ) ; return new UInt8 ( value [ index ] ) ; } @ inline @ operator ( "==" ) static eq ( a , b ) { return a . eq ( b ) ; } @ inline @ operator ( "!=" ) static notEq ( a , b ) { return a . notEq ( b ) ; } }