Hot answers tagged

13

If you are using Stellar JS SDK, the following method will work for you. import StellarBase from 'stellar-base' if (StellarBase.StrKey.isValidEd25519SecretSeed('SB....4A')) { //secret key is valid } if (StellarBase.StrKey.isValidEd25519PublicKey('GA....6C')) { //public key is valid }


12

If you're just interested in checking whether it's a well-formed key, you can use the following algorithm: Verify that the string starts with "S" Base-32 decode the S... string to get the raw bytes. You will end up with 35 bytes. Ignore the first byte since it represents the "S". Calculate the CRC-16 checksum of the next 32 bytes. These bytes represent the ...


3

You can use StrKey.decodeStellarAccountId() wrapped with a try-catch block. If the expression throws an exception, the account id is invalid.


1

At the moment, there are no stellar-django packages. Not sure what you mean here by "seed" but user data shouldn't be stored on any public facing endpoints/public facing endpoints. I think the answer you may be looking for is try implementing in browser signing instead.


Only top voted, non community-wiki answers of a minimum length are eligible