Companion

Functions

Link copied to clipboard
fun random(length: Int = 8, random: Random = PlatformCsprng): TokenGenerator

Random tokens of length bytes. RFC 7252 §5.3.1: a client on the Internet SHOULD use at least 32 bits of randomness against response spoofing; random should be a secure generator, and is the platform's CSPRNG by default.

Link copied to clipboard
fun sessionSequence(length: Int = 8, random: Random = PlatformCsprng): TokenGenerator

Sequence numbers on secure sessions and random tokens elsewhere, the default of every endpoint.