Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e30fb57
feat: add isUintArray type guard
DivitJain26 Jun 5, 2026
719217c
feat: add constructor
DivitJain26 Jun 9, 2026
5998748
feat: add constructor
DivitJain26 Jun 9, 2026
c63d91a
feat: static methods
DivitJain26 Jun 11, 2026
b329b2b
feat: add helpers
DivitJain26 Jun 11, 2026
d7e1be2
feat: add getter and setter
DivitJain26 Jun 11, 2026
2d1b4d9
fix: fixes high and low words assignment in constructor
DivitJain26 Jun 14, 2026
f457469
fix: add collection suppoet in .from method
DivitJain26 Jun 14, 2026
3072571
fix: corrects examples
DivitJain26 Jun 14, 2026
0137613
fix: corrects examples
DivitJain26 Jun 14, 2026
319e327
feat: add entry point
DivitJain26 Jun 14, 2026
881eb7f
feat: add length method
DivitJain26 Jun 14, 2026
f665113
feat: add bytes method
DivitJain26 Jun 14, 2026
30b8f3f
test: adds base test
DivitJain26 Jun 15, 2026
86bd46b
chore: restructure
DivitJain26 Jun 16, 2026
cbec750
test: adds test for from
DivitJain26 Jun 17, 2026
286ba87
fix: fix cr years
DivitJain26 Jun 17, 2026
b1beef0
chore: remove unused imports
DivitJain26 Jun 17, 2026
6af6679
chore: chage unsigend 64-bit to 64-bit unsigned
DivitJain26 Jun 17, 2026
9f4125a
fix: chnge constructor to treat input as single entitiy
DivitJain26 Jun 21, 2026
32da6ed
fix: change from array to validate fomr Uint64 ctor
DivitJain26 Jun 21, 2026
6a249e4
fix: change from method to treat each elemet as single entity
DivitJain26 Jun 21, 2026
a4a072a
refactor: update from method
DivitJain26 Jun 24, 2026
b843e5f
refactor: decouple Uint64Array API from underlying storage layout
DivitJain26 Jun 27, 2026
e1b5c85
refactor: decouple Uint64Array API from underlying storage layout
DivitJain26 Jun 27, 2026
935e9ed
test: refactor test
DivitJain26 Jun 27, 2026
81a843b
fix: replace buf with arg
DivitJain26 Jun 27, 2026
279997b
test: remove bigint
DivitJain26 Jun 27, 2026
275c3fb
test: refatcter set test
DivitJain26 Jun 28, 2026
8b5b95f
refactor: set methods isCollection branch to check of Uint64 instance
DivitJain26 Jun 28, 2026
bfb893b
refactor: set methods isCollection branch to check of Uint64 instance
DivitJain26 Jun 28, 2026
d7afd5b
test: add test fro of and get method
DivitJain26 Jun 28, 2026
c908afb
docs: add types
DivitJain26 Jun 29, 2026
49a18e5
fix: chagew iterator type to Uint64
DivitJain26 Jun 29, 2026
3e820e9
docs: add types tests
DivitJain26 Jun 29, 2026
75ac13a
docs: add repl text
DivitJain26 Jun 30, 2026
39b06c2
fix: fix example
DivitJain26 Jun 30, 2026
25ec345
fix: fix example
DivitJain26 Jun 30, 2026
86f00f7
fix: fix type delecration
DivitJain26 Jul 1, 2026
21e0a35
bench: add benchmarks
DivitJain26 Jul 1, 2026
d5d08dc
docs: add example
DivitJain26 Jul 1, 2026
8b3d08e
fix: fix list error
DivitJain26 Jul 1, 2026
fed7e33
docs: add readme file
DivitJain26 Jul 2, 2026
a64b5c6
chore: reorder properties
DivitJain26 Jul 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
432 changes: 432 additions & 0 deletions lib/node_modules/@stdlib/array/uint64/README.md

Large diffs are not rendered by default.

322 changes: 322 additions & 0 deletions lib/node_modules/@stdlib/array/uint64/benchmark/benchmark.from.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,322 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var ITERATOR_SYMBOL = require( '@stdlib/symbol/iterator' );
var format = require( '@stdlib/string/format' );
var Uint32Array = require( '@stdlib/array/uint32' );
var pkg = require( './../package.json' ).name;
var Uint64Array = require( './../lib' );


// VARIABLES //

var opts = {
'skip': ( ITERATOR_SYMBOL === null )
};


// MAIN //

bench( format( '%s::typed_array:from', pkg ), function benchmark( b ) {
var buf;
var arr;
var i;

buf = new Uint32Array( 0 );

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( buf );
if ( arr.length !== 0 ) {
b.fail( 'should have length 0' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( format( '%s::typed_array:from:len=5', pkg ), function benchmark( b ) {
var buf;
var arr;
var i;

buf = new Uint32Array( 5 );

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( buf );
if ( arr.length !== 5 ) {
b.fail( 'should have length 5' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( format( '%s::typed_array,clbk:from:len=5', pkg ), function benchmark( b ) {
var buf;
var arr;
var i;

buf = new Uint32Array( 5 );

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( buf, clbk );
if ( arr.length !== 5 ) {
b.fail( 'should have length 5' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();

function clbk( v ) {
return v + 1;
}
});

bench( format( '%s::array:from', pkg ), function benchmark( b ) {
var buf;
var arr;
var i;

buf = [];

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( buf );
if ( arr.length !== 0 ) {
b.fail( 'should have length 0' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( format( '%s::array:from:len=5', pkg ), function benchmark( b ) {
var buf;
var arr;
var i;

buf = [ 1, 2, 3, 4, 5 ];

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( buf );
if ( arr.length !== 5 ) {
b.fail( 'should have length 5' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();
});

bench( format( '%s::array,clbk:from:len=5', pkg ), function benchmark( b ) {
var buf;
var arr;
var i;

buf = [ 1, 2, 3, 4, 5 ];

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( buf, clbk );
if ( arr.length !== 5 ) {
b.fail( 'should have length 5' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();

function clbk( v ) {
return v + 1;
}
});

bench( format( '%s::iterable:from', pkg ), opts, function benchmark( b ) {
var arr;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( createIterable() );
if ( arr.length !== 0 ) {
b.fail( 'should have length 0' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();

function createIterable() {
var out;

out = {};
out[ ITERATOR_SYMBOL ] = iterator;

return out;

function iterator() {
return {
'next': next
};
}

function next() {
return {
'done': true
};
}
}
});

bench( format( '%s::iterable:from:len=5', pkg ), opts, function benchmark( b ) {
var arr;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( createIterable() );
if ( arr.length !== 5 ) {
b.fail( 'should have length 5' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();

function createIterable() {
var out;
var i;

out = {};
out[ ITERATOR_SYMBOL ] = iterator;

i = 0;

return out;

function iterator() {
return {
'next': next
};
}

function next() {
i += 1;
if ( i <= 5 ) {
return {
'value': 0,
'done': false
};
}
return {
'done': true
};
}
}
});

bench( format( '%s::iterable,clbk:from:len=5', pkg ), opts, function benchmark( b ) {
var arr;
var i;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
arr = Uint64Array.from( createIterable(), clbk );
if ( arr.length !== 5 ) {
b.fail( 'should have length 5' );
}
}
b.toc();
if ( !(arr instanceof Uint64Array) ) {
b.fail( 'should return an instance' );
}
b.pass( 'benchmark finished' );
b.end();

function createIterable() {
var out;
var i;

out = {};
out[ ITERATOR_SYMBOL ] = iterator;

i = 0;

return out;

function iterator() {
return {
'next': next
};
}

function next() {
i += 1;
if ( i <= 5 ) {
return {
'value': 1,
'done': false
};
}
return {
'done': true
};
}
}

function clbk( v ) {
return v + 1;
}
});
58 changes: 58 additions & 0 deletions lib/node_modules/@stdlib/array/uint64/benchmark/benchmark.get.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var format = require( '@stdlib/string/format' );
var isUint64 = require( '@stdlib/assert/is-uint64' );
var pkg = require( './../package.json' ).name;
var Uint64Array = require( './../lib' );


// MAIN //

bench( format( '%s:get', pkg ), function benchmark( b ) {
var arr;
var N;
var v;
var i;

arr = [];
for ( i = 0; i < 10; i++ ) {
arr.push( i );
}
arr = new Uint64Array( arr );
N = arr.length;

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
v = arr.get( i%N );
if ( !isUint64( v ) ) {
b.fail( 'should return a Uint64' );
}
}
b.toc();
if ( !isUint64( v ) ) {
b.fail( 'should return a Uint64' );
}
b.pass( 'benchmark finished' );
b.end();
});
Loading
Loading