MCPcopy Create free account
hub / github.com/CloudBoost/cloudboost / encode

Function encode

sdk/src/CloudSocketClientLib.js:4551–4560  ·  view source on GitHub ↗

* Return a string representing the specified number. * * @param {Number} num The number to convert. * @returns {String} The string representation of the number. * @api public

(num)

Source from the content-addressed store, hash-verified

4549 * @api public
4550 */
4551 function encode(num) {
4552 var encoded = '';
4553
4554 do {
4555 encoded = alphabet[num % length] + encoded;
4556 num = Math.floor(num / length);
4557 } while (num > 0);
4558
4559 return encoded;
4560 }
4561
4562 /**
4563 * Return the integer value specified by the given string.

Callers 1

yeastFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected