(string, padding_allowed=False)
| 1808 | |
| 1809 | |
| 1810 | def is_ascii_string(string, padding_allowed=False): |
| 1811 | for b in [i.to_bytes(1, sys.byteorder) for i in string]: |
| 1812 | if padding_allowed: |
| 1813 | if not ((ord(b) < 127 and ord(b) > 31) or ord(b) == 0): |
| 1814 | return 0 |
| 1815 | else: |
| 1816 | if not (ord(b) < 127 and ord(b) > 31): |
| 1817 | return 0 |
| 1818 | return 1 |
| 1819 | |
| 1820 | |
| 1821 | def is_base_64(s): |
no outgoing calls
no test coverage detected