function SerialNumber(value, size) {
    if (!(this instanceof SerialNumber)) {
        return new SerialNumber(value, size);
    }

    value = typeof value !== "undefined" ? value : 0;
    size = typeof size !== "undefined" ? size : 32;

    this.serialBits = size;
    this.serialBytes = size / 8;
    this._value = value;
    this._modulo = Math.pow(2, this.serialBits);
    this._half = Math.pow(2, this.serialBits - 1);
    this._maxAdd = this._half - 1;
    this.number = this._value % this._modulo;
}
/*
 * SerialNumber constructor
 * @public
 *
 * @param {number} value The little endian encoded number
 * @param {number} size The size of the serial number space in bits
 */


@param {number} value The little endian encoded number
@param {number} size The size of the serial number space in bits
@param { number } value The little endian encoded number @param { number } size The size of the serial number space in bits
function SerialNumber(value, size) {
    if (!(this instanceof SerialNumber)) {
        return new SerialNumber(value, size);
    }
    value = typeof value !== "undefined" ? value : 0;
    size = typeof size !== "undefined" ? size : 32;
    this.serialBits = size;
    this.serialBytes = size / 8;
    this._value = value;
    this._modulo = Math.pow(2, this.serialBits);
    this._half = Math.pow(2, this.serialBits - 1);
    this._maxAdd = this._half - 1;
    this.number = this._value % this._modulo;
}
function SerialNumber ( value , size ) { if ( ! ( this instanceof SerialNumber ) ) { return new SerialNumber ( value , size ) ; } value = typeof value !== "undefined" ? value : 0 ; size = typeof size !== "undefined" ? size : 32 ; this . serialBits = size ; this . serialBytes = size / 8 ; this . _value = value ; this . _modulo = Math . pow ( 2 , this . serialBits ) ; this . _half = Math . pow ( 2 , this . serialBits - 1 ) ; this . _maxAdd = this . _half - 1 ; this . number = this . _value % this . _modulo ; }
SerialNumber constructor
 @public
SerialNumber constructor @public