diff --git a/docs/secret.rst b/docs/secret.rst
index 14c5f3a7ad2b15607a2373afed626dc8f758e5b1..fa2f65b7cd4595299298bdca1862381f56439dae 100644
--- a/docs/secret.rst
+++ b/docs/secret.rst
@@ -31,7 +31,7 @@ Example
     # This is a nonce, it *MUST* only be used once, but it is not considered
     #   secret and can be transmitted or stored alongside the ciphertext. A
     #   good source of nonce is just 24 random bytes.
-    nonce = nacl.random(24)
+    nonce = nacl.random(nacl.secret.SecretBox.NONCE_SIZE)
 
     # Encrypt our message, it will be exactly 16 bytes longer than the original
     #   message as it stores authentication information alongside it.