How to use the base58.alphabet function in base58

To help you get started, we’ve selected a few base58 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keis / base58 / test_base58.py View on Github external
def test_alphabet_alias_exists_and_equals_bitcoin_alphabet():
    assert_that(alphabet, equal_to(BITCOIN_ALPHABET))
github hyperledger / indy-plenum / plenum / server / pool_manager.py View on Github external
def doStaticValidation(self, identifier, reqId, operation):
        if operation[TXN_TYPE] == NODE:
            if not (DATA in operation and isinstance(operation[DATA], dict)):
                error = "'{}' is missed or not a dict".format(DATA)
                raise InvalidClientRequest(identifier, reqId, error)
            # VerKey must be base58
            if len(set(operation[TARGET_NYM]) - set(base58.alphabet)) != 0:
                error = "'{}' is not a base58 string".format(TARGET_NYM)
                raise InvalidClientRequest(identifier, reqId, error)

            data = operation[DATA]
            for fn, validator in self._dataFieldsValidators:
                if fn in data and not validator(data[fn]):
                    error = "'{}' ('{}') is invalid".format(fn, data[fn])
                    raise InvalidClientRequest(identifier, reqId, error)