MCPcopy Create free account
hub / github.com/Boris-code/feapder / get_sha1

Function get_sha1

feapder/utils/tools.py:1918–1930  ·  view source on GitHub ↗

@summary: 获取唯一的40位值, 用于获取唯一的id --------- @param *args: 参与联合去重的值 --------- @result: ba4868b3f277c8e387b55d9e3d0be7c045cdd89e

(*args)

Source from the content-addressed store, hash-verified

1916
1917
1918def get_sha1(*args):
1919 """
1920 @summary: 获取唯一的40位值, 用于获取唯一的id
1921 ---------
1922 @param *args: 参与联合去重的值
1923 ---------
1924 @result: ba4868b3f277c8e387b55d9e3d0be7c045cdd89e
1925 """
1926
1927 sha1 = hashlib.sha1()
1928 for arg in args:
1929 sha1.update(str(arg).encode())
1930 return sha1.hexdigest() # 40位
1931
1932
1933def get_base64(data):

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected