isBase58.js 615 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = isBase58;
  6. var _assertString = _interopRequireDefault(require("./util/assertString"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. // Accepted chars - 123456789ABCDEFGH JKLMN PQRSTUVWXYZabcdefghijk mnopqrstuvwxyz
  9. var base58Reg = /^[A-HJ-NP-Za-km-z1-9]*$/;
  10. function isBase58(str) {
  11. (0, _assertString.default)(str);
  12. if (base58Reg.test(str)) {
  13. return true;
  14. }
  15. return false;
  16. }
  17. module.exports = exports.default;
  18. module.exports.default = exports.default;