tanbushi commited on
Commit
6fbd168
·
1 Parent(s): ee7dd00
Files changed (2) hide show
  1. README-OCNGX.md +30 -0
  2. nginx/.htpasswd.123 +0 -1
README-OCNGX.md CHANGED
@@ -12,3 +12,33 @@ https://{profile}-ocngx.hf.space
12
  环境变量为:
13
  USERNAME
14
  PASSWORD
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  环境变量为:
13
  USERNAME
14
  PASSWORD
15
+
16
+ ## http 访问 Basic 认证算法
17
+ 用户名: tbs
18
+ 密码: tbs123
19
+
20
+ Basic认证字符串:`dGJzOnRiczEyMw==`
21
+ HTTP请求头格式:`Authorization: Basic dGJzOnRiczEyMw==`
22
+
23
+ **Python:**
24
+ ```python
25
+ import base64
26
+
27
+ credentials = "tbs:tbs123"
28
+ encoded = base64.b64encode(credentials.encode()).decode()
29
+ print(encoded) # dGJzOnRiczEyMw==
30
+ ```
31
+
32
+ **JavaScript:**
33
+ ```javascript
34
+ const credentials = "tbs:tbs123";
35
+ const encoded = btoa(credentials);
36
+ console.log(encoded); // dGJzOnRiczEyMw==
37
+ ```
38
+
39
+ **Node.js:**
40
+ ```javascript
41
+ const credentials = "tbs:tbs123";
42
+ const encoded = Buffer.from(credentials).toString('base64');
43
+ console.log(encoded); // dGJzOnRiczEyMw==
44
+ ```
nginx/.htpasswd.123 DELETED
@@ -1 +0,0 @@
1
- admin:$apr1$4v6n8NMM$ZGl084p0G/l6pnRkRPGi0.