56 Commits
Author SHA1 Message Date
Matt Rubin c9ea1d1e03 [Lint] Prefer Self over the class name for static references prefixes 2022-06-22 11:49:13 -04:00
Matt Rubin 3dfd4e3ffc [Lint] Update SwiftLint configuration 2022-06-22 11:46:14 -04:00
Matt Rubin a5ea490966 Update copyright dates 2019-06-09 17:11:50 -04:00
Matt Rubin d92a9a2f50 Refactor Base32 decoding to use an UnsafeMutableRawBufferPointer 2019-06-09 00:35:14 -04:00
Matt Rubin 8ac153f143 Refactor Base32 encoding to avoid binding the memory buffer
In some circumstances, re-binding a buffer that came from an external Data can result in undefined behavior:
https://forums.swift.org/t/withunsafebytes-data-api-confusion/22142/4
2019-03-28 15:57:05 -04:00
Matt Rubin 24716a764d Migrate off of the deprecated version of withUnsafeBytes 2019-03-28 15:57:05 -04:00
Matt Rubin 09b92a10fe Add Info.plist files to the frameworks 2018-12-13 11:50:26 -05:00
Matt Rubin fda9b9d542 Refactor to avoid force-unwrapping 2018-12-12 13:54:38 -05:00
Matt Rubin a0a946ac5f Refactor calculation of the nonPaddingByteCount 2018-12-12 13:42:57 -05:00
Matt Rubin fa002ed4cf [Lint] Condense a long function 2018-12-12 05:09:22 -05:00
Matt Rubin ac5238764a [Lint] Refactor nonPaddingByteCount() 2018-12-12 04:58:25 -05:00
Matt Rubin 75afd515e0 [Lint] Ensure all fatalError calls have a message 2018-12-12 04:55:49 -05:00
Matt Rubin 27637babff [Lint] Clean up long lines 2018-12-12 04:33:10 -05:00
Matt Rubin 9a47e09f3e [Lint] Clean up formatting of collection literals 2018-12-12 04:29:41 -05:00
Matt Rubin d8ee9dd560 [Lint] Move opening braces to the same line as function declarations 2018-12-12 04:25:25 -05:00
Matt Rubin b22b54e4e9 Improve Base32 decoding performance by avoiding the DecodedBlock enum 2018-12-12 03:34:42 -05:00
Matt Rubin f79f27dbd1 Improve Base32 decoding performance by refactoring character lookup 2018-12-12 03:00:40 -05:00
Matt Rubin f00b1483cf Throw an error if the last encoded character has non-zero padding bits
https://tools.ietf.org/html/rfc4648#section-3.5
2017-02-11 20:28:09 -05:00
Matt Rubin 2bbac3d322 Test incomplete blocks in Base32 decoding 2017-02-10 03:01:24 -05:00
Matt Rubin a0c291b7bd Refactor the calculation of non-padding byte count 2017-02-10 03:01:08 -05:00
Matt Rubin 1c6bf57e9f Clean up Base32 block decoding 2017-02-10 02:19:54 -05:00
Matt Rubin 45f634f0bb Refactor Base32 block decoding 2017-02-10 02:13:55 -05:00
Matt Rubin 730632b5d8 Refactor Base32 block decoding 2017-02-10 02:08:10 -05:00
Matt Rubin 36ffb417e3 Clean up switch statements in Base32 decoding 2017-02-10 02:04:46 -05:00
Matt Rubin a892d3773b Implement Base32 decoding 2017-02-10 01:59:29 -05:00
Matt Rubin 333e04baef Stub a function for Base32 decoding, and add basic tests 2017-02-09 22:43:11 -05:00
Matt Rubin e3b567f9ac Replace comment references to NSData with references to Data 2017-02-09 22:15:07 -05:00
Matt Rubin 5f2a46bcea Fix the license information in the swift file headers 2016-11-16 19:36:32 -05:00
Matt Rubin 5329ea01e0 Clean up converted source files 2016-11-06 16:59:54 -05:00
Matt Rubin 2d530876cb Rename constants and functions to use "ByteCount" instead of "Length" 2016-11-06 16:56:33 -05:00
Matt Rubin 08d2f4a5aa Upgrade to Xcode 8.1 and Swift 3.0.1 2016-11-06 14:57:57 -05:00
Matt Rubin 57a6ced804 Refactor Base32 block encoding 2016-05-01 16:59:04 -04:00
Matt Rubin 275198bffa Add a few comments 2016-04-27 15:21:29 -04:00
Matt Rubin aed745f238 Create an enum namespace for Base32 functions 2016-04-27 15:15:51 -04:00
Matt Rubin 1a20ae5c20 Rename character encoding function 2016-04-27 15:07:18 -04:00
Matt Rubin 194b0d3f49 Add EncodedChar typealias 2016-04-27 15:07:18 -04:00
Matt Rubin 8025452ad1 Move block encoding to its own file 2016-04-27 15:07:18 -04:00
Matt Rubin 1a67842c50 Assorted naming improvements 2016-04-27 15:07:18 -04:00
Matt Rubin 96a17d7e65 Write chars directly into the encoded buffer, without building an array
Reduces runtime by 47%
2016-04-27 02:35:37 -04:00
Matt Rubin 9396cbdbb8 Pass encoded blocks as tuples, to avoid allocating temporary arrays
Reduces runtime by 65%
2016-04-27 02:21:26 -04:00
Matt Rubin 0bd75d323f Instead of concatenating strings, build a CUnsignedChar array
Reduces runtime by 77%
2016-04-27 02:06:49 -04:00
Matt Rubin c83df3436e Use an array instead of a switch statement for encoded character lookup
Reduces runtime by 14%
2016-04-27 01:30:57 -04:00
Matt Rubin ab8c021b94 Use UnsafePointer instead of Array and ArraySlice to pass bytes
Reduces runtime by 4%
2016-04-27 01:17:49 -04:00
Matt Rubin 2adc86ab94 Iterate over the input bytes instead of recursing
Reduces runtime by 68%
2016-04-27 00:57:55 -04:00
Matt Rubin 19cc84b23c Concatenate Strings instead of Characters
Reduces runtime by 66%
2016-04-27 00:48:34 -04:00
Matt Rubin 37d25f855d Consolidate conversion of NSData to byte array 2016-04-26 23:52:04 -04:00
Matt Rubin 8b94b75607 Add Base32 encoding function for NSData 2016-04-26 23:40:32 -04:00
Matt Rubin bf098606db Rename encodedValue(_:) 2016-04-26 23:05:10 -04:00
Matt Rubin 81120033f0 Rename byte-quintet parameters 2016-04-26 23:05:10 -04:00
Matt Rubin cd48638fe8 Remove unnecessary characterOrPaddingForValue(_:) 2016-04-26 23:05:10 -04:00