Function sectok::decode [−][src]
pub fn decode(uri: impl AsRef<[u8]>) -> Option<String>
Decodes the secret-token URI into a secret.
This function accepts everything that can be efficiently treated as a byte slice (for example:
&str
, String
, Vec<u8>
). It returns an owned String
on success and None
when the
- Does not start with the PREFIX
- Has no token
- Has token that contains invalid percent-encoded UTF-8
- Has token that contains disallowed characters (not every character allowed by percent-encoding is permitted by the RFC)