Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 254a750

Browse files
Update 07-常用函数.md
1 parent 497f50c commit 254a750

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎07-常用函数.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- [函数的应用](#函数的应用)
99
- [环比增长](#环比增长)
1010
- [差集](#差集)
11-
- [md5加密](#md5加密)
11+
- [加密](#加密)
1212
- [模糊匹配](#模糊匹配)
1313
- [文本相似度](#文本相似度)
1414
- [json解析](#json解析)
@@ -156,14 +156,22 @@ def difference(left, right, on):
156156

157157
------
158158

159-
### md5加密
159+
### 加密
160160

161161
```python
162+
# md5
162163
import hashlib
163164
def md5Encode(str):
164165
m = hashlib.md5()
165166
m.update(str.encode('utf-8'))
166167
return m.hexdigest()
168+
169+
# sha256
170+
import hashlib
171+
def sha256Encode(str):
172+
m = hashlib.sha256()
173+
m.update(str.encode('utf-8'))
174+
return m.hexdigest()
167175
```
168176

169177
<br/>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /