Skip to content

Commit ad2245f

Browse files
add a bit of documentation
1 parent 8335254 commit ad2245f

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

‎src/add32.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
/**
2+
* Adds to 32-bit signed integers.
3+
*/
14
export const add32 = ( a , b ) => ( a + b ) | 0 ;

‎src/big32.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* Construct a 32-bit signed integer from 4 bytes.
3+
*/
14
export function big32 (a, o) {
25
return (a[o + 0] << 24) | (a[o + 1] << 16) | (a[o + 2] << 8) | a[o + 3];
36
}

‎src/get32.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
1+
/**
2+
* Creates a 32-bit signed integer from anything.
3+
*
4+
* @example
5+
* get32(0xFFFFFFFF); // -1
6+
*
7+
*/
28
export function get32 ( w ) {
39
return w | 0 ;
410
}

0 commit comments

Comments
 (0)