{"id":21373904,"url":"https://github.com/ekscrypto/Base64","last_synced_at":"2025-07-13T08:31:26.649Z","repository":{"id":3619148,"uuid":"4684780","full_name":"ekscrypto/Base64","owner":"ekscrypto","description":"Objective-C Base64 Additions for NSData and NSString","archived":false,"fork":false,"pushed_at":"2022-02-09T05:04:16.000Z","size":129,"stargazers_count":171,"open_issues_count":0,"forks_count":47,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-11-11T21:39:32.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ekscrypto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-16T13:37:16.000Z","updated_at":"2024-11-11T10:17:28.000Z","dependencies_parsed_at":"2022-08-21T02:50:11.841Z","dependency_job_id":null,"html_url":"https://github.com/ekscrypto/Base64","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekscrypto%2FBase64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekscrypto%2FBase64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekscrypto%2FBase64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekscrypto%2FBase64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekscrypto","download_url":"https://codeload.github.com/ekscrypto/Base64/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225868455,"owners_count":17537037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T08:29:34.994Z","updated_at":"2024-11-22T08:29:53.519Z","avatar_url":"https://github.com/ekscrypto.png","language":"Objective-C","funding_links":[],"categories":["OOM-Leaks-Crash"],"sub_categories":["数据安全和算法"],"readme":"![swift workflow](https://github.com/ekscrypto/Base64/actions/workflows/swift.yml/badge.svg) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) ![Issues](https://img.shields.io/github/issues/ekscrypto/Base64) ![Releases](https://img.shields.io/github/v/release/ekscrypto/Base64)\n\nBase64 Additions for Objective-C on Mac OS X and iOS\n=======\n\n## LICENSING\n\nThe project is dual licensed\n* Public Domain\n* MIT\n\nUse it under whichever of these two licensing options that are allowed in your country and you feel the most comfortable with.\n\n## Installation\n*IMPORTANT* If you have access to Swift libraries, use the built-in Base64 functions. They are faster in most cases.\n\n### Installation: Swift Package Manager\n\nIn your Package.swift, add\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"MyApp\",\n    targets: [],\n    dependencies: [\n        .Package(url: \"https://github.com/ekscrypto/Base64.git\", .upToNextMajor(from: \"1.2.2\"))\n    ]\n)\n```\n\n### Installation: Cococapods\n\nAdd the following line to your Podfile:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'Base64'\nend\n```\n\n### Usage: Objective-C\n\n```Objective-C\nNSString *helloWorld = @\"Hello World\";\nNSString *helloInBase64 = [helloWorld base64String];\nNSString *helloDecoded = [NSString stringFromBase64String:helloInBase64];\n```\n\n### Usage: Swift\n\n*NOT RECOMMENDED: If you have access to the built-in base64 functions offered by Swift, use them.  They are much faster.*\n\nUsing MF_Base64codec directly\n\n```Swift\nlet data = \"Hello World\".data(using: .utf8)!\nlet base64 = MF_Base64Codec.base64String(from: data) // SGVsbG8gV29ybGQ=\nlet querySafeBase64 = MF_Base64Codec.base64UrlEncodedString(fromBase64String: base64) // SGVsbG8gV29ybGQ\n```\n\nUsing NSData objects\n```Swift\nlet data = \"Hello World\".data(using: .utf8)! as NSData\nlet base64 = data.base64String() // SGVsbG8gV29ybGQ=\nlet querySafeBase64 = data.base64UrlEncodedString() // SGVsbG8gV29ybGQ\n```\n\n## Performance\n----\n* Encoding: 5% *slower* than Swift's built-in Base64 encoding\n* Encoding: 4 to 5 times faster than using the equivalent SecTransform.\n* Encoding: 30% faster than https://github.com/l4u/NSData-Base64 (metric from 2012)\n* Decoding: 4 times *slower* than Swift's built-in Base64 decoding\n* Decoding: 5% faster than using the equivalent SecTransform.\n* Decoding: 5% faster than https://github.com/l4u/NSData-Base64 (metric from 2012)\n\nPerformance metrics are based on evaluation done in 2022 using macOS, Xcode 13.2.1 and Swift 5.5.2 on a 2.2 GHz 6-Core Intel Core i7 MacBook Pro.\n\n## Requirements\n-----\n* Compile with Automatic Reference Counting\n* Compatible with Mac OSX 10.9+ and iOS 4.0+\n\n\n\n## Implementation\n----\n* Implemented as per RFC 4648, see http://www.ietf.org/rfc/rfc4648.txt for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekscrypto%2FBase64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekscrypto%2FBase64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekscrypto%2FBase64/lists"}