* Yeast: A tiny growing id generator. * * @returns {String} A unique id. * @api public
()
| 4583 | * @api public |
| 4584 | */ |
| 4585 | function yeast() { |
| 4586 | var now = encode(+ new Date()); |
| 4587 | |
| 4588 | if (now !== prev) |
| 4589 | return seed = 0, |
| 4590 | prev = now; |
| 4591 | return now + '.' + encode(seed++); |
| 4592 | } |
| 4593 | |
| 4594 | // |
| 4595 | // Map each character to its index. |
no test coverage detected