Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
/ dnsstamp-swift Public archive

DNS stamps implementation in swift.

License

Notifications You must be signed in to change notification settings

x13a/dnsstamp-swift

Repository files navigation

dnsstamp-swift

DNSStamps implementation in swift.

Example

import DNSStamp

func main() throws {
    let str = "sdns://AAAAAAAAAAAAGltmZTgwOjo2ZDZkOmY3MmM6M2FkOjYwYjhd"
    
    let stamp = try DNSStamp.from(str).get()
    switch stamp {
    case .plainDns(let val):      assert(str == val.encode())
    case .dnsCrypt(let val):      assert(str == val.encode())
    case .doh(let val):           assert(str == val.encode())
    case .dot(let val):           assert(str == val.encode())
    case .doq(let val):           assert(str == val.encode())
    case .odohTarget(let val):    assert(str == val.encode())
    case .dnsCryptRelay(let val): assert(str == val.encode())
    case .odohRelay(let val):     assert(str == val.encode())
    }
}

main()

About

DNS stamps implementation in swift.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Languages