* 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)
| 1025 | * @api public |
| 1026 | */ |
| 1027 | function encode(num) { |
| 1028 | var encoded = ''; |
| 1029 | do { |
| 1030 | encoded = alphabet[num % length] + encoded; |
| 1031 | num = Math.floor(num / length); |
| 1032 | } while (num > 0); |
| 1033 | return encoded; |
| 1034 | } |
| 1035 | /** |
| 1036 | * Yeast: A tiny growing id generator. |
| 1037 | * |