{"id":15038374,"url":"https://github.com/nikolairuhe/swiftdigest","last_synced_at":"2025-10-06T11:12:48.132Z","repository":{"id":140636656,"uuid":"104231679","full_name":"NikolaiRuhe/SwiftDigest","owner":"NikolaiRuhe","description":"Simple md5 implementation in pure Swift with no dependencies.","archived":false,"fork":false,"pushed_at":"2020-05-22T03:10:50.000Z","size":26,"stargazers_count":49,"open_issues_count":9,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T23:43:10.107Z","etag":null,"topics":["md5","md5hashing","swift","swift-4"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/NikolaiRuhe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-20T15:11:44.000Z","updated_at":"2023-12-03T11:54:52.000Z","dependencies_parsed_at":"2023-07-11T01:15:58.525Z","dependency_job_id":null,"html_url":"https://github.com/NikolaiRuhe/SwiftDigest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NikolaiRuhe/SwiftDigest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikolaiRuhe%2FSwiftDigest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikolaiRuhe%2FSwiftDigest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikolaiRuhe%2FSwiftDigest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikolaiRuhe%2FSwiftDigest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NikolaiRuhe","download_url":"https://codeload.github.com/NikolaiRuhe/SwiftDigest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NikolaiRuhe%2FSwiftDigest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278598620,"owners_count":26013291,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["md5","md5hashing","swift","swift-4"],"created_at":"2024-09-24T20:38:13.076Z","updated_at":"2025-10-06T11:12:48.101Z","avatar_url":"https://github.com/NikolaiRuhe.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftDigest\n\nCopyright (c) 2017 Nikolai Ruhe.\n\nSwiftDigest is released under the MIT License.\n\n## Contents\n\nThis is a pure Swift implementation of the MD5 algorithm. I might add more algorithms in the future. Or not.\n\nThe main purpose is to provide hashing through a pure Swift framework without dependencies other than\nSwift Foundation. Currently no effort has been taken to optimze the performance. When hashing more than a\ncouple of kilo bytes it might be better to use Apple's CommonCrypto implementation.\n\n## Examples\n\nHash some `Data`:\n\n    let data = Data()\n    let digest = data.md5\n    print(\"md5: \\(digest)\")\n\n    // prints: \"md5: d41d8cd98f00b204e9800998ecf8427e\"\n\nHash `String` contents:\n\n    let input = \"The quick brown fox jumps over the lazy dog\"\n    let digest = input.utf8.md5\n    print(\"md5: \\(digest)\")\n\n    // prints: \"md5: 9e107d9d372bb6826bd81d3542a419d6\"\n\nHash the main executable:\n\n    let appID = try! Data(contentsOf: Bundle.main.executableURL!).md5\n    // can be used to send a unique id of the app version to a server or so.\n\n## Features\n\nThe `MD5Digest` type is ...\n\n- `Hashable`, so it can be used as a key in dictionaries\n- `RawRepresentable` to convert to and from string representations\n- `CustomStringConvertible` to make printing easy\n- `Codable` to enable JSON and Plist coding of types containing a digest property\n\n## Interface\n\n    /// Represents a 16 byte digest value, created from hashing arbitrary data.\n    public struct MD5Digest : Hashable, RawRepresentable, CustomStringConvertible, Codable {\n\n        /// Perform hashing of the supplied data.\n        public init(from input: Data)\n\n        /// Create a digest from reading a hex representation from the supplied string.\n        public init?(rawValue: String)\n\n        /// The 32 digit hex representation.\n        public var rawValue: String { get }\n\n        /// The 32 digit hex representation.\n        public var description: String { get }\n\n        /// The raw bytes of the digest value, always exactly 16 bytes.\n        public var data: Data { get }\n\n        /// The raw bytes of the digest value as a tuple.\n        public var bytes: (UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8) { get }\n    }\n\n\n    public extension Data {\n\n        /// Computes md5 digest value of the contained bytes.\n        public var md5: MD5Digest { get }\n    }\n\n    public extension String.UTF8View {\n\n        /// Computes md5 digest value of the string's UTF-8 representation.\n        public var md5: MD5Digest { get }\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolairuhe%2Fswiftdigest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikolairuhe%2Fswiftdigest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikolairuhe%2Fswiftdigest/lists"}