a zip code crypto-currency system good for red ONLY

index.js 401B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. var isFinite = require('is-finite');
  3. module.exports = function (str, n) {
  4. if (typeof str !== 'string') {
  5. throw new TypeError('Expected `input` to be a string');
  6. }
  7. if (n < 0 || !isFinite(n)) {
  8. throw new TypeError('Expected `count` to be a positive finite number');
  9. }
  10. var ret = '';
  11. do {
  12. if (n & 1) {
  13. ret += str;
  14. }
  15. str += str;
  16. } while ((n >>= 1));
  17. return ret;
  18. };