CryptographicConstants
public struct CryptographicConstants : Sendable
Cryptographic constants used throughout the SDK. These values define parameters for checksum algorithms, bit operations, and other low-level cryptographic functions.
-
Polynomial value for CRC-16-CCITT-XModem algorithm (0x1021) This is the divisor used in the CRC calculation for StrKey checksums Reference: https://en.wikipedia.org/wiki/Cyclic_redundancy_check
Declaration
Swift
public static let CRC16_POLYNOMIAL: UInt16 -
High bit mask for CRC-16 (0x8000) Used to detect when the most significant bit is set during CRC calculation Reference: https://en.wikipedia.org/wiki/Cyclic_redundancy_check
Declaration
Swift
public static let CRC16_HIGH_BIT_MASK: UInt16 -
Initial CRC-16 value (0x0000) The starting value for CRC-16-CCITT-XModem calculation Reference: https://en.wikipedia.org/wiki/Cyclic_redundancy_check
Declaration
Swift
public static let CRC16_INITIAL: UInt16 -
Size of CRC-16 checksum in bytes (2 bytes) The CRC-16 checksum is appended to StrKey encoded data Reference: Stellar developer docs
Declaration
Swift
public static let CRC16_SIZE: Int -
Number of iterations per byte in CRC-16 calculation (8 iterations) Each byte requires processing all 8 bits Reference: https://en.wikipedia.org/wiki/Cyclic_redundancy_check
Declaration
Swift
public static let CRC16_ITERATIONS: Int
-
Byte mask for bit operations (0xFF) Used to mask values to a single byte (0-255 range)
Declaration
Swift
public static let BYTE_MASK: UInt32 -
Number of bits per byte (8 bits) Standard constant for bit-level operations
Declaration
Swift
public static let BITS_PER_BYTE: Int
View on GitHub
Install in Dash