Functions
The following functions are available globally.
-
Encodes data to base32 string using the standard alphabet.
Uses the standard base32 alphabet (A-Z, 2-7) as defined in RFC 4648.
Example:
let data = Data([1, 2, 3, 4, 5]) let encoded = base32Encode(data)Declaration
Swift
public func base32Encode(_ data: Data) -> StringParameters
dataData to encode
Return Value
Base32-encoded string
-
Encodes data to base32 string using the extended hex alphabet.
Uses the extended hex alphabet (0-9, A-V) as defined in RFC 4648.
Declaration
Swift
public func base32HexEncode(_ data: Data) -> StringParameters
dataData to encode
Return Value
Base32hex-encoded string
-
Decodes a base32 string to data using the standard alphabet.
Example:
if let decoded = base32DecodeToData("AEBAGBA") { // Use decoded data }Declaration
Swift
public func base32DecodeToData(_ string: String) -> Data?Parameters
stringBase32-encoded string
Return Value
Decoded data, or nil if the string is invalid
-
Decodes a base32hex string to data using the extended hex alphabet.
Declaration
Swift
public func base32HexDecodeToData(_ string: String) -> Data?Parameters
stringBase32hex-encoded string
Return Value
Decoded data, or nil if the string is invalid
-
Encodes a byte array to base32 string using the standard alphabet.
Declaration
Swift
public func base32Encode(_ array: [UInt8]) -> StringParameters
arrayByte array to encode
Return Value
Base32-encoded string
-
Encodes a byte array to base32 string using the extended hex alphabet.
Declaration
Swift
public func base32HexEncode(_ array: [UInt8]) -> StringParameters
arrayByte array to encode
Return Value
Base32hex-encoded string
-
Decodes a base32 string to a byte array using the standard alphabet.
Declaration
Swift
public func base32Decode(_ string: String) -> [UInt8]?Parameters
stringBase32-encoded string
Return Value
Decoded byte array, or nil if the string is invalid
-
Decodes a base32hex string to a byte array using the extended hex alphabet.
Declaration
Swift
public func base32HexDecode(_ string: String) -> [UInt8]?Parameters
stringBase32hex-encoded string
Return Value
Decoded byte array, or nil if the string is invalid
-
Returns the absolute value of the given number.
Parameters
xa big double
-
round to largest BInt value not greater than base
-
round to smallest BInt value not less than base
-
Returns a BDouble number raised to a given power.
View on GitHub
Install in Dash
Functions Reference