File: err_174.py

package info (click to toggle)
python-refurb 1.27.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,700 kB
  • sloc: python: 9,468; makefile: 40; sh: 6
file content (27 lines) | stat: -rw-r--r-- 452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import secrets
from secrets import token_bytes, token_hex

# these should match

token_bytes(32).hex()
token_bytes(None).hex()  # noqa: FURB120
token_bytes().hex()
secrets.token_bytes().hex()

token_bytes()[:8]
token_hex()[:8]
token_bytes(None)[:8]  # noqa: FURB120
token_hex(None)[:8]  # noqa: FURB120
secrets.token_bytes()[:8]


# these should not

token_hex()[:5]

bytes().hex()  # noqa: FURB112

n = 32
token_bytes(n).hex()

token_bytes().hex("_")