ilap / pinenacl-dart

The Dart implementation of the PyNaCl API with the TweetNaCl cryptographic library
MIT License
36 stars 4 forks source link

ByteList.fromList replacements #21

Closed danbeechbloom closed 5 months ago

danbeechbloom commented 5 months ago

Hey,

I was using the following implementation of ByteList.fromList with pinenacl: 0.4.2:

ByteList.fromList(
        base64.decode(encodedString),
      ),

I want to upgrade to 0.6.0 but when I try to use this I get errors & can't supply a base64 decoder as the coder param:

 ByteList.decode(encodedString);

Any tips on how to get this to work?

Thanks 👍

ilap commented 5 months ago

Hi,

Sorry, but you need to implement the Encoder interface here: https://github.com/ilap/pinenacl-dart/blob/9a1e440feb909d485e10edc8d5417ae02a441c81/lib/api/encoding.dart#L4

It's relative simple.

danbeechbloom commented 5 months ago

Perfect, thanks for your help 🙌