src/crypto_browser.js
function(number, pad) {
      var endian, i, multiplier, padding, power, remainder, value, _i;
      if (pad == null) {
        pad = true;
      }
      power = Math.floor((Math.log(number) / Math.LN2) / 8) * 8;
      multiplier = Math.pow(2, power);
      value = Math.floor(number / multiplier);
      remainder = number % multiplier;
      endian = "";
      if (remainder > 255) {
        endian += this.stringifyLittleEndian(remainder, false);
      } else if (power !== 0) {
        endian += this.dec2hex(remainder);
      }
      endian += this.dec2hex(value);
      if (pad) {
        padding = 16 - endian.length;
        for (i = _i = 0; _i < padding; i = _i += 1) {
          endian += "0";
        }
      }
      return endian;
    }
function(number, pad) {
      var endian, i, multiplier, padding, power, remainder, value, _i;
      if (pad == null) {
        pad = true;
      }
      power = Math.floor((Math.log(number) / Math.LN2) / 8) * 8;
      multiplier = Math.pow(2, power);
      value = Math.floor(number / multiplier);
      remainder = number % multiplier;
      endian = "";
      if (remainder > 255) {
        endian += this.stringifyLittleEndian(remainder, false);
      } else if (power !== 0) {
        endian += this.dec2hex(remainder);
      }
      endian += this.dec2hex(value);
      if (pad) {
        padding = 16 - endian.length;
        for (i = _i = 0; _i < padding; i = _i += 1) {
          endian += "0";
        }
      }
      return endian;
    }
function ( number , pad ) { var endian , i , multiplier , padding , power , remainder , value , _i ; if ( pad == null ) { pad = true ; } power = Math . floor ( ( Math . log ( number ) / Math . LN2 ) / 8 ) * 8 ; multiplier = Math . pow ( 2 , power ) ; value = Math . floor ( number / multiplier ) ; remainder = number % multiplier ; endian = "" ; if ( remainder > 255 ) { endian += this . stringifyLittleEndian ( remainder , false ) ; } else if ( power !== 0 ) { endian += this . dec2hex ( remainder ) ; } endian += this . dec2hex ( value ) ; if ( pad ) { padding = 16 - endian . length ; for ( i = _i = 0 ; _i < padding ; i = _i += 1 ) { endian += "0" ; } } return endian ; }
Convert an integer into a little endian.
@param {Number} number The integer you want to convert.
@param {Boolean} [pad=true] Pad the little endian with zeroes.
@return {String} The little endian.
Convert an integer into a little endian .