ripple / ripple-address-codec

Address encoding/decoding for the XRP Ledger. Moved to: https://github.com/XRPLF/xrpl.js/tree/develop/packages/ripple-address-codec
https://github.com/XRPLF/xrpl.js/tree/develop/packages/ripple-address-codec
Apache License 2.0
22 stars 23 forks source link

Add isValidSeed(str) function #200

Closed mDuo13 closed 2 years ago

mDuo13 commented 3 years ago

The library exposes isValidXAddress(str) and isValidClassicAddress(str) functions but does not provide the equivalent functionality for base58-encoded seeds. If you're taking user input and you need to confirm whether a pasted seed value is valid (proper base58 & checksum computes) you have to use try/catch on decodeSeed(str) or do some other even more roundabout check rather than getting a convenient boolean.

Adding an isValidSeed(str) function would serve that use case, and could be exported in higher-level libraries as well.

intelliot commented 2 years ago

Replaced by https://github.com/XRPLF/xrpl.js/issues/1811