Skip to content

Glossary: Building APIs with FastAPI

secrets.compare_digest

Also written: secrets module

A Python function that compares two strings in the same time however much they match. Using it instead of `==` stops attackers timing responses to guess a key one character at a time.

Where the book teaches it

Related terms

API key