diff --git a/Sources/TorusUtils/Extensions/String+Extension.swift b/Sources/TorusUtils/Extensions/String+Extension.swift index 33c2f082..c058cf37 100755 --- a/Sources/TorusUtils/Extensions/String+Extension.swift +++ b/Sources/TorusUtils/Extensions/String+Extension.swift @@ -24,15 +24,15 @@ extension String { return hasPrefix("04") } - func add04Prefix() -> String { - if !hasPrefix("04") { + func add04Prefix(targetLength: Int = 128) -> String { + if self.count == targetLength{ return "04" + self } return self } - func strip04Prefix() -> String { - if hasPrefix("04") { + func strip04Prefix(targetLength: Int = 130) -> String { + if hasPrefix("04") && self.count == targetLength { let indexStart = index(startIndex, offsetBy: 2) return String(self[indexStart...]) } diff --git a/Torus-utils.podspec b/Torus-utils.podspec index 79de4a86..e5b249bd 100644 --- a/Torus-utils.podspec +++ b/Torus-utils.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = "Torus-utils" - spec.version = "8.1.0" + spec.version = "8.1.2" spec.ios.deployment_target = "13.0" spec.summary = "Retrieve user shares" spec.homepage = "https://github.com/torusresearch/torus-utils-swift"