NSData+NSString.m 550バイト
//
//  NSData+NSString.m
//  jacket_ios
//
//  Created by ドラッサル 亜嵐 on 2017/06/07.
//  Copyright © 2017年 ドラッサル 亜嵐. All rights reserved.
//

#import "NSData+NSString.h"

@implementation NSData (NSString)

- (NSString *)toString
{
    Byte *dataPointer = (Byte *)[self bytes];
    NSMutableString *result = [NSMutableString stringWithCapacity:0];
    NSUInteger index;
    for (index = 0; index < [self length]; index++)
    {
        [result appendFormat:@"0x%02x,", dataPointer[index]];
    }
    return result;
}

@end