Subject: Re: Base-64 decode (was Property List Editor)
Subject: Re: Base-64 decode (was Property List Editor)
- Subject: Subject: Re: Base-64 decode (was Property List Editor)
- From: Steven Spencer <email@hidden>
- Date: Mon, 13 Jun 2005 11:31:16 +0100
Oops.
Base64Decode array size should be 256, not 255.
Class
-----
#import "dataExtensions.h"
@implementation NSData (Extensions)
const unsigned char Base64Pad = '=';
const unsigned char Base64Encode[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static unsigned char Base64Decode[256];
+ (void)initialize
{
//Build decode table
unsigned int index;
for (index = 0; index < 256; index++)
Base64Decode[index] = 0;
for (index = 0; index < 64; index++)
Base64Decode[Base64Encode[index]] = index;
}
- Steve Spencer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden