utils/utils library

Constants

DEFAULT_LENGTH → const int
FORMAT → const List<int>

Properties

bn53 BigInt
final
bnHundred BigInt
final
bnOne BigInt
final
bnTen BigInt
final
bnThrousand BigInt
final
bnZero BigInt
final

Functions

base64Decode(String value) Uint8List
base64Encode(dynamic value) String
base64Pad(String value) String
base64Trim(String value) String
base64Validate(String? value) bool
bitnot(BigInt bn, {int? bitLength}) BigInt
bnMax(List<BigInt> list) BigInt
bnMin(List<BigInt> list) BigInt
bnSqrt(BigInt bn) BigInt
bnToBn(dynamic value) BigInt
bnToHex(BigInt bn, {int bitLength = -1, Endian endian = Endian.big, bool isNegative = false}) String
bnToU8a(BigInt? value, {int bitLength = -1, Endian endian = Endian.little, bool isNegative = false}) Uint8List
bytesToHex(List<int> bytes, {bool include0x = false}) String
Converts the bytes given as a list of integers into a hexadecimal representation.
bytesToInt(List<int> bytes) BigInt
Converts the bytes from that list (big endian) to a BigInt.
compactToBn(Map<String, dynamic> value) BigInt
convertArray(List<int> arr) Uint8List
convertString(String str, {bool useDartEncode = true}) Uint8List
decodeBigInt(List<int> bytes, {Endian endian = Endian.little}) BigInt
encodeBigInt(BigInt number, {Endian endian = Endian.little, int? bitLength}) Uint8List
flatternArray<T>(List<List<T>> list) List<T>
getRandomValues([int length = DEFAULT_LENGTH]) Uint8List
hexAddPrefix(String? value) String
hexFixLength(String value, [int bitLength = -1, bool withPadding = false]) String
hexHasPrefix(String value) bool
hexStripPrefix(String value) String
hexToBn(dynamic value, {Endian endian = Endian.big, bool isNegative = false}) BigInt
hexToBytes(String hexStr) List<int>
sequence.
hexToNumber(dynamic value) int?
hexToPlainText(String hex) String
hexToString(String value) String
hexToU8a(String value, [int bitLength = -1]) Uint8List
value sholud be 0x hex
hexToU8aStream(String value) Uint8List
isAddress(String str) bool
isAscii(dynamic value) bool
isBase64(String value) bool
isBech32(String str) bool
isBigInt(dynamic value) bool
isBn(dynamic value) bool
isBoolean(dynamic value) bool
isBuffer(dynamic value) bool
isByteString(String byStr, {required int length}) bool
isError(dynamic value) bool
isFunction(dynamic value) bool
isHex(dynamic value, [int bitLength = -1, bool ignoreLength = false]) bool
isHexadecimal(String str) bool
isHexString(String str) bool
isIp(String value, String type) bool
isJsonObject(dynamic value) bool
isNull(dynamic value) bool
isNumber(dynamic value) bool
isObject(dynamic value) bool
isObservable(dynamic value) bool
isPrivateKey(String str) bool
isPublicKey(String str) bool
isSignature(String str) bool
isString(dynamic value) bool
isTestChain(String value) bool
isU8a(dynamic value) bool
isUrl(String url) bool
isUtf8(dynamic value) bool
log2(num x) num
makeBigIntToString(Map input) Map
newtonIteration(BigInt n, BigInt x0) BigInt
numberToHex(dynamic number, {bool pad = false, bool include0x = false, int? forcePadLen}) String
Converts the number, which can either be a dart int or a BigInt, into a hexadecimal representation. The number needs to be positive or zero.
plainTextToHex(String plainText) String
randomAsHex([int length = 32]) String
randomAsNumber() int
randomAsU8a([int length = DEFAULT_LENGTH]) Uint8List
stringCamelCase(String value) String
stringLowerFirst(String value) String
stringShorten(String value, {int prefixLength = 6}) String
stringToU8a(String msg, {String? enc, bool useDartEncode = true}) Uint8List
stringUpperFirst(String value) String
strip0xHex(String hex) String
textDecoder(Uint8List value) String
textEncoder(String value) Uint8List
toHex(dynamic msg) String
u8aConcat(List list) Uint8List
u8aEq(Uint8List a, Uint8List b) bool
u8aFixLength(Uint8List value, {int bitLength = -1, bool atStart = false}) Uint8List
u8aSorted(List<Uint8List> u8as) List<Uint8List>
u8aToBn(Uint8List u8a, {Endian endian = Endian.little, bool isNegative = false}) BigInt
u8aToBuffer(Uint8List u8a) ByteBuffer
u8aToHex(Uint8List u8a, {bool include0x = true}) String
u8aToString(Uint8List u8a, {bool useDartEncode = false}) String
u8aToU8a(dynamic value, {bool useDartEncode = true}) Uint8List
zero2(dynamic word) String