Schafkopf-Server/Sources/App/Extensions/Crypto+Extensions.swift

15 lines
259 B
Swift
Raw Normal View History

import Foundation
import Crypto
extension String {
/**
Create a new access token.
*/
static func newToken() -> String {
Crypto.SymmetricKey.init(size: .bits128).withUnsafeBytes {
$0.hexEncodedString()
}
}
}