|
JubeatPlus 3.9.11
|
String-producing utility helpers. More...
import <Foundation/Foundation.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. | |
String-producing utility helpers.
Reconstructed from Ghidra program Jubeat (image base 0x100000000). All
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.
| 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.
| length | The number of characters to produce. |
length characters, or @"" when length is zero. | 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.
| string | The text to encode. nil is accepted. |
nil if the input was nil or the encoder failed.