dtop / SwiftUUIDv5

Swift impl of UUID v5 (sha1 and namespaced)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
	
	// ...
}

About

Swift impl of UUID v5 (sha1 and namespaced)

License:MIT License


Languages

Language:Swift 65.3%Language:Objective-C 30.1%Language:Shell 4.6%