MCPcopy Create free account
hub / github.com/JohnDoe1996/fastAPI-vue / create_base64_code

Function create_base64_code

backend/app/utils/captcha_code.py:43–45  ·  view source on GitHub ↗
(k: int, *, img_width: int = 100, img_height: int = 50, font_sizes:List[int] = None)

Source from the content-addressed store, hash-verified

41
42
43def create_base64_code(k: int, *, img_width: int = 100, img_height: int = 50, font_sizes:List[int] = None):
44 captcha_img, codes = create_code(k, img_width=img_width, img_height=img_height, font_sizes=font_sizes)
45 return "data:image/png;base64," + base64.b64encode(captcha_img).decode('utf-8'), codes
46
47
48if __name__ == '__main__':

Callers 2

getCaptchaCodeFunction · 0.90
captcha_code.pyFile · 0.85

Calls 1

create_codeFunction · 0.85

Tested by

no test coverage detected