30 lines
791 B
Objective-C
30 lines
791 B
Objective-C
//
|
|
// BJEncryptionTool.m
|
|
// romantic
|
|
//
|
|
// Created by MAC on 2024/8/5.
|
|
// Copyright © 2024 romantic. All rights reserved.
|
|
//
|
|
|
|
#import "BJEncryptionTool.h"
|
|
#import "NSString+category.h"
|
|
|
|
#define Secret_key @"R0M2NzFPU1cxM1hSQUtNVFlKWVI3UFVJUUJCUzUyWU8="
|
|
|
|
@implementation BJEncryptionTool
|
|
|
|
//获取当前时间戳,秒
|
|
+ (NSString *)getNowTimeTimestamp {
|
|
return [NSString stringWithFormat:@"%ld", [[NSString getNowTimeTimestamp3] integerValue]/1000];
|
|
}
|
|
|
|
+ (NSString *)getSignWith:(NSString *)timestamp {
|
|
NSString *str = [NSString stringWithFormat:@"%@%@", Secret_key, timestamp];
|
|
NSString *md5Str = [str md5];
|
|
NSData *data = [md5Str dataUsingEncoding:NSUTF8StringEncoding];
|
|
NSString *base64Str = [data base64EncodedStringWithOptions:0];
|
|
return base64Str;
|
|
}
|
|
|
|
@end
|