mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
17 lines
386 B
Swift
17 lines
386 B
Swift
import Foundation
|
|
|
|
extension Data {
|
|
|
|
static func random(_ length: Int) -> Data {
|
|
return Data((0 ..< length).map { _ in UInt8.random(in: UInt8.min ... UInt8.max) })
|
|
}
|
|
|
|
var hexEncodedString: String {
|
|
map { String(format: "%02hhx", $0) }.joined()
|
|
}
|
|
|
|
static var musixmatchTokenPlaceholder: String {
|
|
"2" + self.random(53).hexEncodedString
|
|
}
|
|
}
|