Obfuscator
public struct Obfuscator
The struct that encapsulates decoding and encoding process of strings obfuscation
-
Initialize new instanse of
Obfuscator
struct with given salt stringDeclaration
Swift
public init(with salt: String)
Parameters
salt
salt which will be used for encoding and decoding of string for obfuscation, should not be empty
Return Value
new instanse of
Obfuscator
struct
-
Encode given
string
parameter with salt provided early in initDeclaration
Swift
public func obfuscatingBytes(from string: String) -> [UInt8]
Parameters
string
original string for obfuscation
Return Value
array of bytes
-
Decode given
bytes
to original string. The salt must be the same as the one used inobfuscatingBytes(from:)
function.Declaration
Swift
public func revealString(from bytes: [UInt8]) -> String?
Parameters
bytes
array of bytes
Return Value
Optional original string
-
Decode given
bytes
to original string. The salt must be the same as the one used inobfuscatingBytes(from:)
function.Declaration
Swift
public func revealData(from bytes: [UInt8]) -> Data
Parameters
bytes
array of bytes
Return Value
Data representation of original string