基础类方法:生成随机验证码
codeLength验证码长度
+ (NSString *)randomCode:(int)codeLength
{
CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *radomString = [(NSString*)CFBridgingRelease(CFUUIDCreateString(nil, uuidObj)) substringToIndex:codeLength];
CFRelease(uuidObj);
return radomString;
}
网友评论