|
JubeatPlus 3.9.11
|
The NSData Base64 category and its two upstream C codecs.
More...
import <Foundation/Foundation.h>
Go to the source code of this file.
Classes | |
| category | NSData(Base64) |
Base64 encoding and decoding for NSData, from Matt Gallagher's NSData+Base64. More... | |
Functions | |
| NS_ASSUME_NONNULL_BEGIN char *_Nullable | NewBase64Encode (const void *pvBuffer, size_t cbLength, size_t *_Nullable pcbOutputLength) |
| Base64-encodes a byte buffer, returning a freshly allocated NUL-terminated ASCII string. | |
| void *_Nullable | NewBase64Decode (const char *pszInput, size_t cbLength, size_t *_Nullable pcbOutputLength) |
| Base64-decodes an ASCII buffer, returning a freshly allocated byte buffer. | |
The NSData Base64 category and its two upstream C codecs.
Reconstructed from Ghidra program Jubeat (image base 0x100000000). All
NSData+Base64, so the two C codecs are library code, documented only to the extent needed to use them correctly. They are genuine free functions: neither takes an object receiver nor belongs to a class, and each is called only from the category methods here. | void *_Nullable NewBase64Decode | ( | const char * | pszInput, |
| size_t | cbLength, | ||
| size_t *_Nullable | pcbOutputLength ) |
Base64-decodes an ASCII buffer, returning a freshly allocated byte buffer.
A cbLength of (size_t)-1 means the input is NUL-terminated and its length is measured with strlen. Invalid characters are skipped rather than rejected. The output is sized ((cbLength+3)/4)*3.
| pszInput | The Base64 text to decode. |
| cbLength | The number of input bytes, or (size_t)-1 for a NUL-terminated input. |
| pcbOutputLength | Receives the decoded byte count when not nullptr. |
malloc'd output; the caller must free() it. | NS_ASSUME_NONNULL_BEGIN char *_Nullable NewBase64Encode | ( | const void * | pvBuffer, |
| size_t | cbLength, | ||
| size_t *_Nullable | pcbOutputLength ) |
Base64-encodes a byte buffer, returning a freshly allocated NUL-terminated ASCII string.
The output is sized ((cbLength+2)/3)*4+1 and uses the standard alphabet with '=' padding. This copy is the three-argument variant with upstream's separateLines parameter stripped, so no seventy-six-column line breaks are emitted. Returns nullptr without writing anything if the allocation fails, in which case pcbOutputLength is left untouched, so a caller cannot distinguish failure from a zero-length encode.
| pvBuffer | The bytes to encode. |
| cbLength | The number of input bytes. |
| pcbOutputLength | Receives the output length excluding the NUL when not nullptr. |
malloc'd, NUL-terminated output; the caller must free() it.