As of 0.9.2 of the crypto
package
CryptoUtils
is deprecated. Use theBase64
APIs indart:convert
and the hex APIs in theconvert
package instead.
import 'dart:convert' show utf8, base64;
main() {
final str="https://dartpad.dartlang.org/";
final encoded = base64.encode(UTF8.encode(str));
print('base64: $encoded');
final str2 = utf8.decode(base64.decode(encoded));
print(str2);
print(str == str2);
}
Try it in DartPad