mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-25 12:59:24 +00:00
30 lines
923 B
Dart
30 lines
923 B
Dart
/*
|
|
* This file is part of Stack Wallet.
|
|
*
|
|
* Copyright (c) 2023 Cypher Stack
|
|
* All Rights Reserved.
|
|
* The code is distributed under GPLv3 license, see LICENSE file for details.
|
|
* Generated by Cypher Stack on 2023-05-26
|
|
*
|
|
*/
|
|
|
|
import 'dart:convert';
|
|
import 'dart:typed_data';
|
|
|
|
import 'package:dart_bs58/dart_bs58.dart';
|
|
import 'package:dart_bs58check/dart_bs58check.dart';
|
|
import 'package:hex/hex.dart';
|
|
import 'package:stackwallet/utilities/extensions/extensions.dart';
|
|
|
|
extension StringExtensions on String {
|
|
Uint8List get toUint8ListFromUtf8 => Uint8List.fromList(utf8.encode(this));
|
|
|
|
Uint8List get toUint8ListFromHex =>
|
|
Uint8List.fromList(HEX.decode(startsWith("0x") ? substring(2) : this));
|
|
|
|
Uint8List get toUint8ListFromBase58Encoded => bs58.decode(this);
|
|
|
|
Uint8List get toUint8ListFromBase58CheckEncoded => bs58check.decode(this);
|
|
|
|
BigInt get toBigIntFromHex => toUint8ListFromHex.toBigInt;
|
|
}
|