Unsigned integer module from Glize library.
npm install uint --save
import {uint8, uint16, uint32} from 'uint';
/**
* Converts given <code>number</code> to unsigned int8.
* @param {number} number The number to be converted.
* @return {number} The unsigned (zero or positive) number.
*/
console.log(uint8(0)); // 0
console.log(uint8(1)); // 1
console.log(uint8(255)); // 255
console.log(uint8(256)); // NaN
console.log(uint8(-256)); // NaN
console.log(uint8(-1)); // NaN
console.log(uint16(0)); // 0
console.log(uint16(1)); // 1
console.log(uint16(65535)); // 65535
console.log(uint16(65536)); // NaN
console.log(uint16(-65536)); // NaN
console.log(uint16(-1)); // NaN
console.log(uint32(0)); // 0
console.log(uint32(1)); // 1
console.log(uint32(4294967295)); // 4294967295
console.log(uint32(4294967296)); // NaN
console.log(uint32(-4294967296)); // NaN
console.log(uint32(-1)); // NaN
For more information please visit Glize project page.