JubeatPlus 3.9.11
Loading...
Searching...
No Matches
StringUtilities.h File Reference

String-producing utility helpers. More...

import <Foundation/Foundation.h>
Include dependency graph for StringUtilities.h:

Go to the source code of this file.

Functions

NS_ASSUME_NONNULL_BEGIN NSString * CreateRandomString (NSUInteger length)
 Builds a random string of the given length from a fixed sixty-four-character alphabet.
NSString *_Nullable CreateUrlEncodedString (NSString *_Nullable string)
 Percent-encodes a string for use in a URL, allowing only alphanumerics.

Detailed Description

String-producing utility helpers.

Reconstructed from Ghidra program Jubeat (image base 0x100000000). All

Ghidra address:
values are offsets relative to that image base.

Both are genuine free functions: neither takes a receiver argument nor belongs to a class, so the reconstruction rules' search for an owning class is exhausted and they stay free functions. They sit beside the digest helpers in Md5Utilities in the binary's address space.

Function Documentation

◆ CreateRandomString()

NS_ASSUME_NONNULL_BEGIN NSString * CreateRandomString ( NSUInteger length)

Builds a random string of the given length from a fixed sixty-four-character alphabet.

Each character is drawn from the alphabet with a masked arc4random() value (a bitmask, not a modulo: the alphabet is exactly sixty-four bytes, so the mask is uniform with no bias). Because arc4random() is a CSPRNG this is suitable for nonce and token use. A length of zero returns the shared empty string without allocating.

Parameters
lengthThe number of characters to produce.
Returns
An autoreleased random string of exactly length characters, or @"" when length is zero.
Ghidra address:
0x7efd8

◆ CreateUrlEncodedString()

NSString *_Nullable CreateUrlEncodedString ( NSString *_Nullable string)

Percent-encodes a string for use in a URL, allowing only alphanumerics.

Forwards to -stringByAddingPercentEncodingWithAllowedCharacters: with +[NSCharacterSet alphanumericCharacterSet], which is stricter than the URL query set: the RFC 3986 unreserved marks "-", ".", "_", and "~" are percent-encoded too. The set is Unicode-aware, so non-ASCII letters pass through unencoded rather than being UTF-8 percent-encoded. A nil input yields nil, indistinguishable from the encoder itself returning nil.

Parameters
stringThe text to encode. nil is accepted.
Returns
The autoreleased percent-encoded string, or nil if the input was nil or the encoder failed.
Ghidra address:
0x7fb90