/SwiftUUIDv5

Swift impl of UUID v5 (sha1 and namespaced)

Primary LanguageSwiftMIT LicenseMIT

SwiftUUIDv5

Build Status Compatibility Carthage compatible GitHub license codebeat badge GitHub release

#####Extension for generating v5 UUIDs

By Danilo Topalovic.

Introduction

UUIDv5 is commonly used for generating namespace based unique identifiers. the namespace is also a valid UUID.

see: wikipedia

Requirements

Swift 3.0

Installation

currently only Carthage is supported, sorry.

Cartfile:

github "dtop/SwiftUUIDv5"

Example

if let namespace = UUID(uuidString: "6BA7B811-9DAD-11D1-80B4-00C04FD430C8") {
	
	guard let customerUuid = UUID(namespace: namespace, name: "your-customer@customer.com") else {
		// ...
	}
	
	let customerId = customerUuid.uuidString
	
	// ...
}