1- # -*- coding: utf-8 -*-
21# --------------------------------------------------------
32# Licensed under the terms of the BSD 3-Clause License
43# (see LICENSE for details).
5- # Copyright © 2018-2023 , A.A Suvorov
4+ # Copyright © 2018-2024 , A.A Suvorov
65# All rights reserved.
76# --------------------------------------------------------
87# https://github.com/smartlegionlab
@@ -16,23 +15,23 @@ class RandomStringMaster:
1615 letters = string .ascii_letters
1716
1817 @classmethod
19- def get (cls , length = 10 ):
18+ def create (cls , length = 10 ):
2019 return '' .join ((random .choice (cls .letters ) for _ in range (length )))
2120
2221
2322class RandomNumberMaster :
2423 numbers = string .digits
2524
2625 @classmethod
27- def get (cls , length = 10 ):
26+ def create (cls , length = 10 ):
2827 return '' .join ((random .choice (cls .numbers ) for _ in range (length )))
2928
3029
3130class RandomSymbolMaster :
3231 symbols = '@$!%*#?&-'
3332
3433 @classmethod
35- def get (cls , length = 10 ):
34+ def create (cls , length = 10 ):
3635 return '' .join ((random .choice (cls .symbols ) for _ in range (length )))
3736
3837
@@ -42,13 +41,13 @@ class RandomPasswordMaster:
4241 symbols = '@$!%*#?&-'
4342
4443 @classmethod
45- def get (cls , length = 10 ):
44+ def create (cls , length = 10 ):
4645 return '' .join ((random .choice (cls .letters + cls .numbers + cls .symbols ) for _ in range (length )))
4746
4847
4948class RandomHashMaster :
5049 @classmethod
51- def get (cls , text ):
50+ def create (cls , text ):
5251 sha = hashlib .sha3_512 (text .encode ('utf-8' ))
5352 new_hash = sha .hexdigest ()
5453 return new_hash
@@ -62,7 +61,7 @@ class RandomMaster:
6261 hash = RandomHashMaster ()
6362
6463 @classmethod
65- def get_code (cls , length = 10 , number_flag = False , string_flag = False , symbol_flag = False ):
64+ def create_code (cls , length = 10 , number_flag = False , string_flag = False , symbol_flag = False ):
6665 data = ''
6766 if string_flag :
6867 data += cls .string .letters
0 commit comments