APObfuscatedString

1.2.0

String category for binary obfuscation
aporat/APObfuscatedString

What's New

1.2.0

2025-04-15T13:38:32Z

APObfuscatedString

A Swift package that extends String and NSMutableString with fluent, chainable properties to append lowercase letters (a-z), uppercase letters (A-Z), and numbers (0-9). This library simplifies string construction in a readable, expressive way, useful for tasks like obfuscation, shorthand notation, or dynamic string generation.

GitHub Actions Workflow Status codecov

Features

  • Immutable String Support: Append characters to String and get a new string back.
  • Mutable String Support: Append characters to NSMutableString in place, with chainable methods.
  • Comprehensive Coverage: Includes all 26 lowercase letters, 26 uppercase letters, and 10 digits.
  • Swift Package Manager: Easy integration into your Swift projects.

Requirements

  • Swift 5.9 or later
  • iOS 16.0+, tvOS 13.0+, macOS 12.0+

Installation

Swift Package Manager

Add APObfuscatedString to your project via Swift Package Manager:

  1. In Xcode, go to File > Add Package Dependency.
  2. Enter the repository URL:
    https://github.com/aporat/APObfuscatedString.git
    
  3. Specify the version or branch (e.g., main) and add it to your target.

Or, manually add it to your Package.swift:

dependencies: [
    .package(url: "https://github.com/aporat/APObfuscatedString.git", from: "1.0.0")
]

Then include it in your target:

.target(name: "YourTarget", dependencies: ["APObfuscatedString"])

Usage

String (Immutable)

Append characters to a String to create a new string:

import APObfuscatedString

let base = "hello"
let result = base._h._e._l._l._o // "hellohello"
print(result)

let mixed = "start"._a._B._1 // "startaB1"
print(mixed)

NSMutableString (Mutable)

Append characters to an NSMutableString in place:

import APObfuscatedString

let mutable = NSMutableString(string: "hello")
mutable._w._o._r._l._d // Modifies mutable to "helloworld"
print(mutable) // "helloworld"

let chained = mutable._1._2._3 // Modifies mutable to "helloworld123"
print(chained) // "helloworld123"

Examples

  • Obfuscation: Build hard-to-read strings dynamically:
    let obfuscated = ""._x._Y._z._9 // "xYz9"
  • Shorthand: Quickly append identifiers:
    let id = "user"._1._2._3 // "user123"

License

This project is licensed under the MIT License. See the LICENSE file for details.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Apr 27 2025 14:44:49 GMT-0900 (Hawaii-Aleutian Daylight Time)