Here you can find the source of toHex(len)
"use strict";/*from www. j a va 2 s.co m*/ /*jshint freeze:false */ /** @file Contains all extension methods used in the product. */ /** Converts the number to an upper=case hexidecimal string of the given length, * possibly truncating significant digits. No leading markers are given. * * @param {Number} len The length of the output string * @return {String} An upper-case hexidecimal string representation of the * number, truncated or zero-padded to the given length. */ Number.prototype.toHex = function(len) { var str = this.toString(16); str = str.toUpperCase(); str = str.substr(0, len); while(str.length < len) { str = "0" + str; } return str; }; /*jshint freeze:true */
Number.prototype.toHex = function() { var hex = this.toString(16); if (hex.length == 1) { hex = "0" + hex; return hex;
Number.prototype.toHex = function () { var upper = (this.valueOf() >> 4) & 0x0F, lower = this.valueOf() & 0x0F; return upper.toString(16) + lower.toString(16); };
Number.prototype.toHex = function() try var val = this.valueOf(); val = parseInt(val); val = Math.max(0,val); val = Math.min(val,255); val = Math.round(val); ...
Number.prototype.toHex = function() { if (this < 16) { return '0' + this.toString(16); return this.toString(16);
Number.prototype.toHex = function(length) { var str = this.toString(16); while (str.length < length) str = '0' + str; str = str.toUpperCase(); return str; }; Number.prototype.toChar = function() { return String.fromCharCode(this); ...
Number.prototype.toHex = function (offset) { return this.toString(16).toUpperCase() };
Number.prototype.toHexByte = function() { var s = this.toString(16).toUpperCase(); if (s.length == 1) { s = "0" + s; return ">" + s; };
Number.prototype.toHexByteShort = function() { var s = this.toString(16).toUpperCase(); if (s.length == 1) { s = "0" + s; return s; };