Update README.md
This commit is contained in:
parent
8002ded925
commit
8730e18bc6
50
README.md
50
README.md
|
@ -2,3 +2,53 @@
|
|||
|
||||
[](https://travis-ci.org/yaslab/ULID.swift)
|
||||
[](https://codecov.io/gh/yaslab/ULID.swift)
|
||||
|
||||
Implementation of [ULID](https://github.com/ulid/spec/blob/master/README.md) in Swift.
|
||||
|
||||
## Usage
|
||||
|
||||
### Generate ULID
|
||||
|
||||
```swift
|
||||
// Generate ULID using current time
|
||||
let ulid = ULID()
|
||||
|
||||
// Get ULID string
|
||||
let string: String = ulid.ulidString
|
||||
// Get ULID binary data
|
||||
let data: Data = ulid.ulidData
|
||||
```
|
||||
|
||||
### Parse ULID
|
||||
|
||||
```swift
|
||||
// Parse ULID string
|
||||
let ulid = ULID(ulidString: "01D0YHEWR9WMPY4NNTPK1MR1TQ")
|
||||
|
||||
// Get Timestamp as Date
|
||||
let timestamp: Date = ulid.timestamp
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
### CocoaPods
|
||||
|
||||
```
|
||||
pod 'ULID.swift', '~> 1.0.0'
|
||||
```
|
||||
|
||||
### Carthage
|
||||
|
||||
```
|
||||
github "yaslab/ULID.swift" ~> 1.0.0
|
||||
```
|
||||
|
||||
### Swift Package Manager
|
||||
|
||||
```
|
||||
.package(url: "https://github.com/yaslab/ULID.swift.git", .upToNextMinor(from: "1.0.0"))
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
ULID.swift is released under the MIT license. See the [LICENSE](https://github.com/yaslab/ULID.swift/blob/master/LICENSE) file for more info.
|
||||
|
|
Loading…
Reference in New Issue