uint.js
function UInt(args) {
  // Assign default valus
  this._value = null;
  this._bytes = null;
  this._bits  = null;
  this._isHex = false;
  // Set constraints if present
  if(args && (isNatural(args.bits) || isNatural(args.bytes))) {
    // Set the size if either is used
    this._bits  = args.bits  || 0;
    this._bytes = args.bytes || 0;
    // Normalize the byte/bit counts
    this._bytes += Math.floor(this._bits / 8);
    this._bits = this._bits % 8;
  }
  // Set the value and check if present
  if(args && (_(args.value).isNumber() || _(args.value).isString() || 
              _(args.value).isArray())) {
    var result = normalize(args.value);
    this._value = result.value;

    // Set the sizes or validate if present
    if(_(this._bytes).isNull() && _(this._bits).isNull()) {
      this._bytes = result.bytes;
      this._bits  = result.bits;
    } else if(this._bytes < result.bytes || 
             (this._bytes === result.bytes && this._bits < result.bits)) {
      throw 'Value is larger than size constraints: ' + args.value + ' ' + 
             this._bytes + ':' + this._bits;
    }
    // Insert any necessary leading zeros
    if(_(this._value).isArray()) {
      _(this._bytes - this._value.length).times(function() {
        this._value.splice(0, 0, 0);
      }, this);
    // Handle the case of user supplied array boundary but small value
    } else if(this._bytes > 4) {
      var tmp = [];
      _(this._bytes).times(function(i) {
        if(i < 4) {
          tmp.splice(0, 0, this._value % 256);
          this._value = Math.floor(this._value / 256);
        } else {
          tmp.splice(0, 0, 0);
        }
      }, this);
      this._value = tmp;
    }
  }

  //Set isHex if string starts with 0x
    if(args && _(args.value).isString()){
      var arr = args.value.match(/^0x/i);
      if(arr !== null){
        this._isHex = true;
      }  
      else{
        this._isHex = false;
      }
    }
}
function UInt(args) {
  // Assign default valus
  this._value = null;
  this._bytes = null;
  this._bits  = null;
  this._isHex = false;
  // Set constraints if present
  if(args && (isNatural(args.bits) || isNatural(args.bytes))) {
    // Set the size if either is used
    this._bits  = args.bits  || 0;
    this._bytes = args.bytes || 0;
    // Normalize the byte/bit counts
    this._bytes += Math.floor(this._bits / 8);
    this._bits = this._bits % 8;
  }
  // Set the value and check if present
  if(args && (_(args.value).isNumber() || _(args.value).isString() || 
              _(args.value).isArray())) {
    var result = normalize(args.value);
    this._value = result.value;

    // Set the sizes or validate if present
    if(_(this._bytes).isNull() && _(this._bits).isNull()) {
      this._bytes = result.bytes;
      this._bits  = result.bits;
    } else if(this._bytes < result.bytes || 
             (this._bytes === result.bytes && this._bits < result.bits)) {
      throw 'Value is larger than size constraints: ' + args.value + ' ' + 
             this._bytes + ':' + this._bits;
    }
    // Insert any necessary leading zeros
    if(_(this._value).isArray()) {
      _(this._bytes - this._value.length).times(function() {
        this._value.splice(0, 0, 0);
      }, this);
    // Handle the case of user supplied array boundary but small value
    } else if(this._bytes > 4) {
      var tmp = [];
      _(this._bytes).times(function(i) {
        if(i < 4) {
          tmp.splice(0, 0, this._value % 256);
          this._value = Math.floor(this._value / 256);
        } else {
          tmp.splice(0, 0, 0);
        }
      }, this);
      this._value = tmp;
    }
  }

  //Set isHex if string starts with 0x
    if(args && _(args.value).isString()){
      var arr = args.value.match(/^0x/i);
      if(arr !== null){
        this._isHex = true;
      }  
      else{
        this._isHex = false;
      }
    }
}
function UInt ( args ) { // Assign default valus
 this . _value = null ; this . _bytes = null ; this . _bits = null ; this . _isHex = false ; // Set constraints if present
 if ( args && ( isNatural ( args . bits ) || isNatural ( args . bytes ) ) ) { // Set the size if either is used
 this . _bits = args . bits || 0 ; this . _bytes = args . bytes || 0 ; // Normalize the byte/bit counts
 this . _bytes += Math . floor ( this . _bits / 8 ) ; this . _bits = this . _bits % 8 ; } // Set the value and check if present
 if ( args && ( _ ( args . value ) . isNumber ( ) || _ ( args . value ) . isString ( ) || _ ( args . value ) . isArray ( ) ) ) { var result = normalize ( args . value ) ; this . _value = result . value ; // Set the sizes or validate if present
 if ( _ ( this . _bytes ) . isNull ( ) && _ ( this . _bits ) . isNull ( ) ) { this . _bytes = result . bytes ; this . _bits = result . bits ; } else if ( this . _bytes < result . bytes || ( this . _bytes === result . bytes && this . _bits < result . bits ) ) { throw 'Value is larger than size constraints: ' + args . value + ' ' + this . _bytes + ':' + this . _bits ; } // Insert any necessary leading zeros
 if ( _ ( this . _value ) . isArray ( ) ) { _ ( this . _bytes - this . _value . length ) . times ( function ( ) { this . _value . splice ( 0 , 0 , 0 ) ; } , this ) ; // Handle the case of user supplied array boundary but small value
 } else if ( this . _bytes > 4 ) { var tmp = [ ] ; _ ( this . _bytes ) . times ( function ( i ) { if ( i < 4 ) { tmp . splice ( 0 , 0 , this . _value % 256 ) ; this . _value = Math . floor ( this . _value / 256 ) ; } else { tmp . splice ( 0 , 0 , 0 ) ; } } , this ) ; this . _value = tmp ; } } //Set isHex if string starts with 0x
 if ( args && _ ( args . value ) . isString ( ) ) { var arr = args . value . match ( / ^0x / i ) ; if ( arr !== null ) { this . _isHex = true ; } else { this . _isHex = false ; } } }
FIXME old version memoizes 'HEX' if used to set
FIXME old version memoizes HEX if used to set