TRON iOS Objective-C address generate
Related Document: TRON公链概览
引用文件来源于这里: PocketEOS-IOS
Secrect Key Generation:
#import <Security/Security.h>
#import "NSObject+Extension.h"
#import "sha3.h"
#include "libbase58.h"
#include "sha2.h"
#include "uECC.h"
...
int length = 32;
uint8_t randomBytes[length];
int randomResult = SecRandomCopyBytes(kSecRandomDefault, length, randomBytes);
if(randomResult == 0) {
NSMutableString *randomSecrect =
[[NSMutableString alloc] initWithCapacity:length * 2];
for(NSInteger index = 0; index < length; index++){
[randomSecrect appendFormat:@"%02x", randomBytes[index]];
}
}