Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

#652 Support padding for Base32 encoded secrets on iOS #707

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mobile/ios/Classes/OTPAuthURL.m
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ + (NSData *)base32Decode:(NSString *)string {
[GTMStringEncoding stringEncodingWithString:kBase32Charset];
[coder addDecodeSynonyms:kBase32Synonyms];
[coder ignoreCharacters:kBase32Sep];
[coder setPaddingChar:'=']
[coder setDoPad:YES];
return [coder decode:string];
}

Expand All @@ -194,6 +196,8 @@ + (NSString *)encodeBase32:(NSData *)data {
[GTMStringEncoding stringEncodingWithString:kBase32Charset];
[coder addDecodeSynonyms:kBase32Synonyms];
[coder ignoreCharacters:kBase32Sep];
[coder setPaddingChar:'=']
[coder setDoPad:YES];
return [coder encode:data];
}

Expand Down