mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
266 B
Swift
9 lines
266 B
Swift
4 years ago
|
|
||
|
public enum Hex {
|
||
|
|
||
|
public static func isValid(_ string: String) -> Bool {
|
||
|
let allowedCharacters = CharacterSet(charactersIn: "0123456789ABCDEF")
|
||
|
return string.uppercased().unicodeScalars.allSatisfy { allowedCharacters.contains($0) }
|
||
|
}
|
||
|
}
|