mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
implement login and status request for fetching metrics from repeaters
This commit is contained in:
parent
4010cfc3b2
commit
84df5aa57f
5 changed files with 240 additions and 0 deletions
24
src/buffer_utils.js
Normal file
24
src/buffer_utils.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
class BufferUtils {
|
||||
|
||||
static areBuffersEqual(byteArray1, byteArray2) {
|
||||
|
||||
// ensure length is the same
|
||||
if(byteArray1.length !== byteArray2.length){
|
||||
return false;
|
||||
}
|
||||
|
||||
// ensure each item is the same
|
||||
for(let i = 0; i < byteArray1.length; i++){
|
||||
if(byteArray1[i] !== byteArray2[i]){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// arrays are the same
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default BufferUtils;
|
||||
Loading…
Add table
Add a link
Reference in a new issue