MCPcopy
hub / github.com/Neo23x0/yarGen / is_ascii_string

Function is_ascii_string

yarGen.py:1810–1818  ·  view source on GitHub ↗
(string, padding_allowed=False)

Source from the content-addressed store, hash-verified

1808
1809
1810def 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
1821def is_base_64(s):

Callers 2

filter_string_setFunction · 0.85
extract_hex_stringsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected