Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

isEqualUint8Array

Test if two arguments are both Uint8Arrays and have equal values.

Usage

var isEqualUint8Array = require( '@stdlib/assert/is-equal-uint8array' );

isEqualUint8Array( v1, v2 )

Tests if two arguments are both Uint8Arrays and have equal values.

var Uint8Array = require( '@stdlib/array/uint8' );

var x = new Uint8Array( [ 1, 2 ] );
var y = new Uint8Array( [ 1, 2 ] );
var bool = isEqualUint8Array( x, y );
// returns true

bool = isEqualUint8Array( x, new Uint8Array( [ 1, 3 ] ) );
// returns false

Examples

var Uint8Array = require( '@stdlib/array/uint8' );
var isEqualUint8Array = require( '@stdlib/assert/is-equal-uint8array' );

var x = new Uint8Array( [ 1, 2, 3 ] );
var y = new Uint8Array( [ 1, 2, 3 ] );
var out = isEqualUint8Array( x, y );
// returns true

x = new Uint8Array( [ 0, 0, 0 ] );
y = [ 0, 0, 0 ];
out = isEqualUint8Array( x, y );
// returns false

x = new Uint8Array( [ 1, 2, 3 ] );
y = new Uint8Array( [ 1, 2, 4 ] );
out = isEqualUint8Array( x, y );
// returns false