Data
public extension Data
-
Declaration
Swift
init?(base58Decoding string: String, alphabet: [UInt8] = Base58String.btcAlphabet) -
Get a hex-encoded string representation of the data.
Declaration
Swift
func hexEncodedString() -> StringReturn Value
Base16 encoded string representation of the data.
-
Return the data as a hex encoded string
Declaration
Swift
var hex: String { get } -
Init a
Dataobject with a base64 string.Throws
If the string is not a valid base64 string.Declaration
Swift
init(base64: String) throwsParameters
base64The data encoded as a base64 string.
-
Init a
Dataobject with a hex string.Throws
If the string is not a valid hex string.Declaration
Swift
init(hex: String) throwsParameters
hexThe data encoded as a hex string.
-
Initializes a data object from a Base16 encoded string.
Declaration
Swift
init?(hexString: String)Parameters
hexStringA Base16 encoded string.
-
Returns the SHA256 hash of the data.
Declaration
Swift
var sha256: Data { get } -
Returns the current Data as a base58 encoded String.
Declaration
Swift
var base58EncodedString: String { get } -
Decodes the given base58 String and returns it as Data, if valid.
Declaration
Swift
static func decode(base58: String) -> Data?Parameters
base58A Base58 encoded string.
Return Value
The base58 String as Data.
-
Variable length unsigned integer Encoded as base 128 with the high bit of the last byte 0, and all other bytes 1
Declaration
Swift
static func varUInt(_ value: UInt32) -> DataParameters
valueThe value as a UInt32
Return Value
The variable length unsigned integer as Data
-
Compresses a public key.
Declaration
Swift
var toCompressedPublicKey: Data? { get } -
Returns an EOSIO public key as a string formatted PUB_R1_xxxxxxxxxxxxxxxxxxx.
Declaration
Swift
var toEosioR1PublicKey: String { get } -
Returns an EOSIO public key as a string formatted PUB_K1_xxxxxxxxxxxxxxxxxxx.
Declaration
Swift
var toEosioK1PublicKey: String { get } -
Returns a legacy EOSIO public key as a string formatted EOSxxxxxxxxxxxxxxxxxxx.
Declaration
Swift
var toEosioLegacyPublicKey: String { get } -
Returns an EOSIO public key as a string formatted PUB_[curve]_xxxxxxxxxxxxxxxxxxx.
Declaration
Swift
func toEosioPublicKey(curve: String) throws -> String -
Returns an EOSIO signature as a string formatted SIG_R1_xxxxxxxxxxxxxxxxxxx.
Declaration
Swift
var toEosioR1Signature: String { get } -
Returns an EOSIO signature as a string formatted SIG_K1_xxxxxxxxxxxxxxxxxxx.
Declaration
Swift
var toEosioK1Signature: String { get } -
Returns an EOSIO private key as a string formatted PVT_R1_xxxxxxxxxxxxxxxxxxx
Declaration
Swift
var toEosioR1PrivateKey: String { get } -
Returns an EOSIO private key as a string formatted PVT_K1_xxxxxxxxxxxxxxxxxxx
Declaration
Swift
var toEosioK1PrivateKey: String { get } -
Init data signature from EOSIO R1 signature string.
Declaration
Swift
init(eosioR1Signature: String) throws -
Init data signature from EOSIO signature string.
Declaration
Swift
init(eosioSignature: String) throws -
Create a Data object in compressed ANSI X9.63 format from an EOSIO public key.
Declaration
Swift
init(eosioPublicKey: String) throws -
Create a Data object from an EOSIO private key.
Declaration
Swift
init(eosioPrivateKey: String) throws
View on GitHub
Data Extension Reference