MCPcopy Create free account
hub / github.com/apache/fory / create_string

Function create_string

python/pyfory/tests/test_metastring.py:62–76  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

60
61
62def create_string(length):
63 chars = []
64 for j in range(length):
65 n = j % 64
66 if n < 26:
67 chars.append(chr(ord("a") + n))
68 elif n < 52:
69 chars.append(chr(ord("A") + (n - 26)))
70 elif n < 62:
71 chars.append(chr(ord("0") + (n - 52)))
72 elif n == 62:
73 chars.append(".")
74 else:
75 chars.append("_")
76 return "".join(chars)
77
78
79def test_metastring():

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected