chore(i18n,curriculum): processed translations (#42868)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d824a367417b2b2512c45
|
||||
title: Anonymous Message Board
|
||||
title: 匿名留言板
|
||||
challengeType: 4
|
||||
forumTopicId: 301568
|
||||
dashedName: anonymous-message-board
|
||||
@@ -8,38 +8,38 @@ dashedName: anonymous-message-board
|
||||
|
||||
# --description--
|
||||
|
||||
Build a full stack JavaScript app that is functionally similar to this: <https://anonymous-message-board.freecodecamp.rocks/>.
|
||||
構建一個功能上與此相似的全棧式 JavaScript 應用程序:<https://anonymous-message-board.freecodecamp.rocks/>。
|
||||
|
||||
Working on this project will involve you writing your code using one of the following methods:
|
||||
在這個項目中,你將使用以下方法之一編寫你的代碼:
|
||||
|
||||
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-messageboard/) and complete your project locally.
|
||||
- Use [our repl.it starter project](https://repl.it/github/freeCodeCamp/boilerplate-project-messageboard) to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
- 克隆[這個 GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-messageboard/) 並在本地完成你的項目。
|
||||
- 使用 [我們的 Replit 啓動項目](https://replit.com/github/freeCodeCamp/boilerplate-project-messageboard)來完成你的項目。
|
||||
- 使用一個你喜歡的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
|
||||
|
||||
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your projects source code in the `GitHub Link` field.
|
||||
完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
|
||||
|
||||
# --instructions--
|
||||
|
||||
1. Set `NODE_ENV` to test without quotes when ready to write tests and DB to your databases connection string (in `.env`)
|
||||
2. Recommended to create controllers/handlers and handle routing in `routes/api.js`
|
||||
3. You will add any security features to `server.js`
|
||||
1. 當準備寫測試和數據庫連接字符串時,設置`NODE_ENV`爲不帶引號的變量(在`.env`文件中)。
|
||||
2. 建議在 `routes/api.js` 中創建控制器/處理器並處理路由。
|
||||
3. 你將在 `server.js` 中添加任何安全功能。
|
||||
|
||||
Write the following tests in `tests/2_functional-tests.js`:
|
||||
在 `tests/2_functional-tests.js` 中編寫下以下測試:
|
||||
|
||||
- Creating a new thread: POST request to `/api/threads/{board}`
|
||||
- Viewing the 10 most recent threads with 3 replies each: GET request to `/api/threads/{board}`
|
||||
- Deleting a thread with the incorrect password: DELETE request to `/api/threads/{board}` with an invalid `delete_password`
|
||||
- Deleting a thread with the correct password: DELETE request to `/api/threads/{board}` with a valid `delete_password`
|
||||
- Reporting a thread: PUT request to `/api/threads/{board}`
|
||||
- Creating a new reply: POST request to `/api/replies/{board}`
|
||||
- Viewing a single thread with all replies: GET request to `/api/replies/{board}`
|
||||
- Deleting a reply with the incorrect password: DELETE request to `/api/threads/{board}` with an invalid `delete_password`
|
||||
- Deleting a reply with the correct password: DELETE request to `/api/threads/{board}` with a valid `delete_password`
|
||||
- Reporting a reply: PUT request to `/api/replies/{board}`
|
||||
- 創建一個新的主題:發送 POST 請求到 `/api/threads/{board}`。
|
||||
- 查看最近的 10 個主題,每個主題有 3 個回覆:發送 GET 請求到 `/api/threads/{board}`
|
||||
- 使用錯誤密碼刪除主題:使用錯誤的`delete_password`向`/api/threads/{board}`發出DELETE請求
|
||||
- 用正確的密碼刪除一個主題:向`/api/threads/{board}`發出DELETE請求,並提供有效的`delete_password`。
|
||||
- 報告一個主題:發送 PUT 請求到 `/api/threads/{board}`。
|
||||
- 創建一個新的回覆:發送 POST 請求到 `/api/replies/{board}`。
|
||||
- 查看一個帶有所有回覆的主題:發送 GET 請求到`/api/replies/{board}`。
|
||||
- 使用錯誤密碼刪除一個回覆:使用無效的`delete_password`向`/api/replies/{board}`發出DELETE請求。
|
||||
- 使用正確密碼刪除一個回覆:使用有效的`delete_password`向`/api/replies/{board}`發出DELETE請求。
|
||||
- 報告一個回覆:發送 PUT 請求到 `/api/replies/{board}`。
|
||||
|
||||
# --hints--
|
||||
|
||||
You can provide your own project, not the example URL.
|
||||
提交自己的項目,而不是示例的 URL。
|
||||
|
||||
```js
|
||||
(getUserInput) => {
|
||||
@@ -51,7 +51,7 @@ You can provide your own project, not the example URL.
|
||||
};
|
||||
```
|
||||
|
||||
Only allow your site to be loaded in an iFrame on your own pages.
|
||||
只允許你的網站在你自己的頁面上以 iFrame 方式加載。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -61,7 +61,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
Do not allow DNS prefetching.
|
||||
不允許 DNS 預取。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -71,7 +71,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
Only allow your site to send the referrer for your own pages.
|
||||
只允許你的網站爲你自己的頁面發送 referrer 請求頭。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -81,55 +81,81 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
You can send a POST request to `/api/threads/{board}` with form data including `text` and `delete_password`. The saved database record will have at least the fields `_id`, `text`, `created_on`(date & time), `bumped_on`(date & time, starts same as `created_on`), `reported` (boolean), `delete_password`, & `replies` (array).
|
||||
你可以向 `/api/threads/{board}` 發送一個 POST 請求,其中包括 `text` 和 `delete_password` 的表單數據。 保存的數據庫記錄將至少有 `_id`、`text`、`created_on`(date & time)、`bumped_on`(date & time, starts same as `created_on`)、`reported`(布爾值)、`delete_password`、& `replies`(數組)。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
const date = new Date();
|
||||
const text = `fcc_test_${date}`;
|
||||
const deletePassword = 'delete_me';
|
||||
const data = { text, delete_password: deletePassword };
|
||||
const url = getUserInput('url');
|
||||
const res = await fetch(url + '/api/threads/fcc_test', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
if (res.ok) {
|
||||
const checkData = await fetch(url + '/api/threads/fcc_test');
|
||||
const parsed = await checkData.json();
|
||||
try {
|
||||
assert.equal(parsed[0].text, text);
|
||||
assert.isNotNull(parsed[0]._id);
|
||||
assert.equal(new Date(parsed[0].created_on).toDateString(), date.toDateString());
|
||||
assert.equal(parsed[0].bumped_on, parsed[0].created_on);
|
||||
assert.isArray(parsed[0].replies);
|
||||
} catch (err) {
|
||||
throw new Error(err.responseText || err.message);
|
||||
}
|
||||
} else {
|
||||
throw new Error(`${res.status} ${res.statusText}`);
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
你可以向 `/api/replies/{board}` 發送一個 POST 請求,其中包括字段 `text`、`delete_password` & `thread_id`。 這將更新 `bumped_on` 日期到評論日期。 在主題的 `replies` 數組中,將保存一個對象,至少有 `_id`、`text`、`created_on`、`delete_password`、& `reported` 這些屬性。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
You can send a POST request to `/api/replies/{board}` with form data including `text`, `delete_password`, & `thread_id`. This will update the `bumped_on` date to the comment's date. In the thread's `replies` array, an object will be saved with at least the properties `_id`, `text`, `created_on`, `delete_password`, & `reported`.
|
||||
你可以向 `/api/threads/{board}` 發送一個 GET 請求。 返回的將是一個數組,包括論壇上最近的 10 個被回覆的主題,及每個主題最新的 3 個回帖。 `reported` 和 `delete_password` 字段將不會被髮送到客戶端。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
You can send a GET request to `/api/threads/{board}`. Returned will be an array of the most recent 10 bumped threads on the board with only the most recent 3 replies for each. The `reported` and `delete_password` fields will not be sent to the client.
|
||||
你可以向 `/api/replies/{board}?thread_id={thread_id}` 發送一個 GET 請求。 返回的將是帶有所有的回覆的整個主題,不包括與之前測試相同的客戶端字段。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
You can send a GET request to `/api/replies/{board}?thread_id={thread_id}`. Returned will be the entire thread with all its replies, also excluding the same fields from the client as the previous test.
|
||||
你可以向 `/api/threads/{board}` 發送一個 DELETE 請求,並傳遞 `thread_id` & `delete_password` 來刪除該線程。 返回的將是字符串 `incorrect password` 或 `success`。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
You can send a DELETE request to `/api/threads/{board}` and pass along the `thread_id` & `delete_password` to delete the thread. Returned will be the string `incorrect password` or `success`.
|
||||
你可以向 `/api/replies/{board}` 發送一個 DELETE 請求,並傳遞 `thread_id`、`reply_id`、& `delete_password`。 返回的將是字符串 `incorrect password` 或 `success`。 成功後,`reply_id` 的文本將更改爲 `[deleted]`。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
You can send a DELETE request to `/api/replies/{board}` and pass along the `thread_id`, `reply_id`, & `delete_password`. Returned will be the string `incorrect password` or `success`. On success, the text of the `reply_id` will be changed to `[deleted]`.
|
||||
你可以向 `/api/threads/{board}` 發送一個 PUT 請求,並傳遞 `thread_id`。 返回的將是字符串 `success`。 `thread_id` 回覆的 `reported` 值將改爲 `true`。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
You can send a PUT request to `/api/threads/{board}` and pass along the `thread_id`. Returned will be the string `success`. The `reported` value of the `thread_id` will be changed to `true`.
|
||||
你可以通過向 `/api/replies/{board}` 發送 PUT 請求並傳遞 `thread_id` & `reply_id`。 返回的將是字符串 `success`。 `reply_id` 的 `reported` 值將被改變爲 `true`。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
You can send a PUT request to `/api/replies/{board}` and pass along the `thread_id` & `reply_id`. Returned will be the string `success`. The `reported` value of the `reply_id` will be changed to `true`.
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
All 10 functional tests are complete and passing.
|
||||
所有 10 項功能測試都已完成並通過。
|
||||
|
||||
```js
|
||||
|
||||
|
@@ -1,33 +1,34 @@
|
||||
---
|
||||
id: 5e46f979ac417301a38fb932
|
||||
title: Port Scanner
|
||||
title: 端口掃描器
|
||||
challengeType: 10
|
||||
forumTopicId: 462372
|
||||
helpCategory: Python
|
||||
dashedName: port-scanner
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Create a port scanner using Python.
|
||||
使用 Python 創建一個端口掃描器。
|
||||
|
||||
You can access [the full project description and starter code on Repl.it](https://repl.it/github/freeCodeCamp/boilerplate-port-scanner).
|
||||
你可以訪問 [Replit 上的完整項目描述和啓動代碼](https://replit.com/github/freeCodeCamp/boilerplate-port-scanner)。
|
||||
|
||||
After going to that link, fork the project. Once you complete the project based on the instructions in 'README.md', submit your project link below.
|
||||
在打開鏈接之後 fork 該項目。 根據 “README.md” 中的指示完成整個項目,然後在下面提交你的項目鏈接。
|
||||
|
||||
We are still developing the interactive instructional part of the Python curriculum. For now, here are some videos on the freeCodeCamp.org YouTube channel that will teach you some of the Python skills required for this project:
|
||||
Python 課程的交互式教學部分仍在開發當中。 目前,freeCodeCamp YouTube 頻道上的一些視頻將會教授你這個項目要求的一些 Python 技能。
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href='https://www.freecodecamp.org/news/python-for-everybody/'>Python for Everybody Video Course</a> (14 hours)
|
||||
<a href='https://www.freecodecamp.org/news/python-for-everybody/'>Python for Everybody 視頻課程</a>(14 小時)
|
||||
</li>
|
||||
<li>
|
||||
<a href='https://www.freecodecamp.org/news/learn-python-basics-in-depth-video-course/'>Learn Python Video Course</a> (2 hours)
|
||||
<a href='https://www.freecodecamp.org/news/learn-python-basics-in-depth-video-course/'>Learn Python 視頻課程</a>(2 小時)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
# --hints--
|
||||
|
||||
It should pass all Python tests.
|
||||
它應該通過所有的 Python 測試。
|
||||
|
||||
```js
|
||||
|
||||
|
@@ -1,23 +1,28 @@
|
||||
---
|
||||
id: 5e601c775ac9d0ecd8b94aff
|
||||
title: Secure Real Time Multiplayer Game
|
||||
title: 安全的實時多人遊戲
|
||||
challengeType: 4
|
||||
forumTopicId: 462375
|
||||
dashedName: secure-real-time-multiplayer-game
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
Develop a 2D real time multiplayer game using the HTML Canvas API and [Socket.io](https://socket.io/) that is functionally similar to this: <https://secure-real-time-multiplayer-game.freecodecamp.rocks/>. Working on this project will involve you writing your code using one of the following methods:
|
||||
使用 HTML Canvas API 和 [Socket.io](https://socket.io/) 開發一個 2D 實時多人遊戲,其功能與此類似:<https://secure-real-time-multiplayer-game.freecodecamp.rocks/>。 在這個項目中,你將使用以下方法之一編寫你的代碼:
|
||||
|
||||
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-secure-real-time-multiplayer-game/) and complete your project locally.
|
||||
- Use [our repl.it starter project](https://repl.it/github/freeCodeCamp/boilerplate-project-secure-real-time-multiplayer-game) to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
- 克隆[這個 GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-secure-real-time-multiplayer-game/),並在本地完成你的項目。
|
||||
- 使用[我們的 Replit 初始項目](https://replit.com/github/freeCodeCamp/boilerplate-project-secure-real-time-multiplayer-game)來完成你的項目。
|
||||
- 使用您選擇的站點生成器來完成項目。 需要確定包含了我們 GitHub 倉庫的所有文件。
|
||||
|
||||
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your project's source code in the `GitHub Link` field.
|
||||
完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後在 `Solution Link` 框中提交你的項目 URL。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
|
||||
|
||||
# --instructions--
|
||||
|
||||
**注意** :`helmet@^3.21.3` 是用戶故事所必需的。 這意味着你需要使用以前版本的 Helmet 的文檔,瞭解如何實現用戶故事的信息。
|
||||
|
||||
# --hints--
|
||||
|
||||
You can provide your own project, not the example URL.
|
||||
提交自己的項目,而不是示例的 URL。
|
||||
|
||||
```js
|
||||
(getUserInput) => {
|
||||
@@ -29,112 +34,134 @@ You can provide your own project, not the example URL.
|
||||
};
|
||||
```
|
||||
|
||||
Multiple players can connect to a server and play.
|
||||
多個玩家可以連接到一臺服務器遊玩。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
Each player has an avatar.
|
||||
每個玩家都有頭像。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
Each player is represented by an object created by the `Player` class in `Player.mjs`.
|
||||
每個玩家都由在 `Player.mjs` 中創建的 `Player` 類對象來代表。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
At a minimum, each player object should contain a unique `id`, a `score`, and `x` and `y` coordinates representing the player's current position.
|
||||
至少,每個玩家對象應該包含一個唯一的 `id`、一個 `score`,以及代表玩家當前位置的 `x` 和 `y` 座標。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
The game has at least one type of collectible item. Complete the `Collectible` class in `Collectible.mjs` to implement this.
|
||||
遊戲至少有一種類型的可收藏物品。 在 `Collectible.mjs` 中完成 `Collectible` 類來實現這一點。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
At a minimum, each collectible item object created by the `Collectible` class should contain a unique `id`, a `value`, and `x` and `y` coordinates representing the item's current position.
|
||||
至少,每個由 `Collectible` 類創建的可收集物品對象應該包含一個唯一的 `id`、一個 `value`,以及代表該物品當前位置的 `x` 和 `y` 座標。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
Players can use the WASD and/or arrow keys to move their avatar. Complete the `movePlayer` method in `Player.mjs` to implement this.
|
||||
玩家可以使用 WASD 或方向鍵移動頭像。 完成 `Player.mjs` 中的 `movePlayer` 方法來實現這一功能。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
The `movePlayer` method should accept two arguments: a string of "up", "down", "left", or "right", and a number for the amount of pixels the player's position should change. `movePlayer` should adjust the `x` and `y` coordinates of the player object it's called from.
|
||||
`movePlayer` 方法應該接受兩個參數:一個是 “up”、“down”、“left” 或 “right” 的字符串,另一個是玩家角色位置應該改變的像素數量。 `movePlayer` 應該調整它所調用的玩家對象的 `x` 和 `y` 座標。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
The player's score should be used to calculate their rank among the other players. Complete the `calculateRank` method in the `Player` class to implement this.
|
||||
用玩家的分數來計算他們相對其他玩家的名次。 在 `Player` 類中完成 `calculateRank` 方法來實現這個。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
The `calculateRank` method should accept an array of objects representing all connected players and return the string `Rank: currentRanking/totalPlayers`. For example, in a game with two players, if Player A has a score of 3 and Player B has a score of 5, `calculateRank` for Player A should return `Rank: 2/2`.
|
||||
`calculateRank` 方法應該接受一個代表所有在線玩家的對象數組,並返回字符串 `Rank: currentRanking/totalPlayers`。 例如,在一局有兩個玩家的遊戲中,如果玩家 A 的分數是 3,玩家 B 的分數是 5,那麼玩家 A 的 `calculateRank` 應該返回 `Rank: 2/2`。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
Players can collide with a collectible item. Complete the `collision` method in `Player.mjs` to implement this.
|
||||
玩家可以與可收集物品發生碰撞。 完成 `Player.mjs` 中的 `collision` 方法來實現這一點。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
The `collision` method should accept a collectible item's object as an argument. If the player's avatar intersects with the item, the `collision` method should return `true`.
|
||||
`collision` 方法應該接受一個可收集物品的對象作爲參數。 如果玩家的頭像與物品相交,`collision` 方法應該返回 `true`。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
All players are kept in sync.
|
||||
所有玩家都保持遊戲狀態同步。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
Players can disconnect from the game at any time.
|
||||
玩家可以隨時斷開與遊戲的連接。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
Prevent the client from trying to guess / sniff the MIME type.
|
||||
阻止客戶端試圖猜測/嗅探 MIME 類型。
|
||||
|
||||
```js
|
||||
|
||||
async (getUserInput) => {
|
||||
const data = await fetch(getUserInput('url') + '/_api/app-info');
|
||||
const parsed = await data.json();
|
||||
assert.equal(parsed.headers['x-content-type-options'], 'nosniff');
|
||||
};
|
||||
```
|
||||
|
||||
Prevent cross-site scripting (XSS) attacks.
|
||||
防止跨站腳本(XSS)攻擊。
|
||||
|
||||
```js
|
||||
|
||||
async (getUserInput) => {
|
||||
const data = await fetch(getUserInput('url') + '/_api/app-info');
|
||||
const parsed = await data.json();
|
||||
assert.equal(parsed.headers['x-xss-protection'], '1; mode=block');
|
||||
};
|
||||
```
|
||||
|
||||
Nothing from the website is cached in the client.
|
||||
客戶端沒有緩存任何網站內容。
|
||||
|
||||
```js
|
||||
|
||||
async (getUserInput) => {
|
||||
const data = await fetch(getUserInput('url') + '/_api/app-info');
|
||||
const parsed = await data.json();
|
||||
assert.equal(parsed.headers['surrogate-control'], 'no-store');
|
||||
assert.equal(
|
||||
parsed.headers['cache-control'],
|
||||
'no-store, no-cache, must-revalidate, proxy-revalidate'
|
||||
);
|
||||
assert.equal(parsed.headers['pragma'], 'no-cache');
|
||||
assert.equal(parsed.headers['expires'], '0');
|
||||
};
|
||||
```
|
||||
|
||||
The headers say that the site is powered by "PHP 7.4.3" even though it isn't (as a security measure).
|
||||
請求頭顯示該網站是由 “PHP 7.4.3” 驅動的,儘管實際並非如此(作爲一種安全防禦措施)。
|
||||
|
||||
```js
|
||||
|
||||
async (getUserInput) => {
|
||||
const data = await fetch(getUserInput('url') + '/_api/app-info');
|
||||
const parsed = await data.json();
|
||||
assert.equal(parsed.headers['x-powered-by'], 'PHP 7.4.3');
|
||||
};
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
@@ -1,33 +1,34 @@
|
||||
---
|
||||
id: 5e46f983ac417301a38fb933
|
||||
title: SHA-1 Password Cracker
|
||||
title: SHA-1 密碼破解器
|
||||
challengeType: 10
|
||||
forumTopicId: 462374
|
||||
helpCategory: Python
|
||||
dashedName: sha-1-password-cracker
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
For this project you will learn about the importance of good security by creating a password cracker to figure out passwords that were hashed using SHA-1.
|
||||
在這個項目中,你將通過創建一個密碼破解器來找出使用 SHA-1 散列的密碼,從而瞭解到良好安全的重要性。
|
||||
|
||||
You can access [the full project description and starter code on Repl.it](https://repl.it/github/freeCodeCamp/boilerplate-SHA-1-password-cracker).
|
||||
你可以訪問 [Replit 上的完整項目描述和啓動代碼](https://replit.com/github/freeCodeCamp/boilerplate-SHA-1-password-cracker)。
|
||||
|
||||
After going to that link, fork the project. Once you complete the project based on the instructions in 'README.md', submit your project link below.
|
||||
進入該鏈接後,fork 該項目。 一旦你根據 “README.md” 中的說明完成了項目,請在下面提交你的項目鏈接。
|
||||
|
||||
We are still developing the interactive instructional part of the Python curriculum. For now, here are some videos on the freeCodeCamp.org YouTube channel that will teach you some of the Python skills required for this project:
|
||||
我們仍在開發 Python 課程的交互式教學部分。 目前,freeCodeCamp.org YouTube 頻道上的一些視頻可以教你這個項目所需的一些 Python 技能。
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a href='https://www.freecodecamp.org/news/python-for-everybody/'>Python for Everybody Video Course</a> (14 hours)
|
||||
<a href='https://www.freecodecamp.org/news/python-for-everybody/'>Python for Everybody 視頻課程</a>(14 小時)
|
||||
</li>
|
||||
<li>
|
||||
<a href='https://www.freecodecamp.org/news/learn-python-basics-in-depth-video-course/'>Learn Python Video Course</a> (2 hours)
|
||||
<a href='https://www.freecodecamp.org/news/learn-python-basics-in-depth-video-course/'>Learn Python 視頻課程</a>(2 小時)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
# --hints--
|
||||
|
||||
It should pass all Python tests.
|
||||
它應該通過所有的 Python 測試。
|
||||
|
||||
```js
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d824a367417b2b2512c44
|
||||
title: Stock Price Checker
|
||||
title: 股票價格查看器
|
||||
challengeType: 4
|
||||
forumTopicId: 301572
|
||||
dashedName: stock-price-checker
|
||||
@@ -8,36 +8,36 @@ dashedName: stock-price-checker
|
||||
|
||||
# --description--
|
||||
|
||||
Build a full stack JavaScript app that is functionally similar to this: <https://stock-price-checker.freecodecamp.rocks/>.
|
||||
構建一個 JavaScript 的全棧應用,在功能上與這個應用相似:<https://stock-price-checker.freecodecamp.rocks/>。
|
||||
|
||||
Since all reliable stock price APIs require an API key, we've built a workaround. Use <https://stock-price-checker-proxy.freecodecamp.rocks/> to get up-to-date stock price information without needing to sign up for your own key.
|
||||
由於所有可靠的股票價格 API 都需要一個 API 密鑰,我們已經建立了一個解決方案。 使用 [https://stock-price-checer-proxy.freecodecamp.rocks/](https://stock-price-checker-proxy.freecodecamp.rocks/) 獲取最新的股票價格信息,而無需註冊您自己的密鑰。
|
||||
|
||||
Working on this project will involve you writing your code using one of the following methods:
|
||||
可以採用下面的任意一種方式完成這個挑戰:
|
||||
|
||||
- Clone [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-stockchecker/) and complete your project locally.
|
||||
- Use [our repl.it starter project](https://repl.it/github/freeCodeCamp/boilerplate-project-stockchecker) to complete your project.
|
||||
- Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.
|
||||
- 克隆 [this GitHub repo](https://github.com/freeCodeCamp/boilerplate-project-stockchecker/) 並在本地完成項目。
|
||||
- 使用[我們的 Replit 啓動項目](https://replit.com/github/freeCodeCamp/boilerplate-project-stockchecker)來完成你的項目。
|
||||
- 使用你選擇的網站生成器來完成項目。 需要包含我們 GitHub 倉庫的所有文件。
|
||||
|
||||
When you are done, make sure a working demo of your project is hosted somewhere public. Then submit the URL to it in the `Solution Link` field. Optionally, also submit a link to your projects source code in the `GitHub Link` field.
|
||||
完成本項目後,請將一個正常運行的 demo(項目演示)託管在可以公開訪問的平臺。 然後將 URL 提交到 `Solution Link` 中。 此外,還可以將項目的源碼提交到 `GitHub Link` 中。
|
||||
|
||||
# --instructions--
|
||||
|
||||
1. SET `NODE_ENV` to `test` without quotes and set `DB` to your MongoDB connection string
|
||||
2. Complete the project in `routes/api.js` or by creating a handler/controller
|
||||
3. You will add any security features to `server.js`
|
||||
4. You will create all of the functional tests in `tests/2_functional-tests.js`
|
||||
1. 將 `NODE_ENV` 設置爲 `test`,不帶引號,並將 `DB` 設爲你的 MongoDB 連接字符串。
|
||||
2. 在 `routes/api.js` 中完成項目,或者通過創建一個處理程序/控制器來完成項目
|
||||
3. 添加安全功能到 `server.js`。
|
||||
4. 在 `tests/2_functional-tests.js` 中創建所有的功能測試
|
||||
|
||||
Write the following tests in `tests/2_functional-tests.js`:
|
||||
在 `tests/2_functional-tests.js` 中編寫下以下測試:
|
||||
|
||||
- Viewing one stock: GET request to `/api/stock-prices/`
|
||||
- Viewing one stock and liking it: GET request to `/api/stock-prices/`
|
||||
- Viewing the same stock and liking it again: GET request to `/api/stock-prices/`
|
||||
- Viewing two stocks: GET request to `/api/stock-prices/`
|
||||
- Viewing two stocks and liking them: GET request to `/api/stock-prices/`
|
||||
- 查看股價:發送 GET 請求到 `/api/stock-prices/`
|
||||
- 查看一個股票並關注它:發送 GET 請求到 `/api/stock-prices/`
|
||||
- 查看同一只股票並再次發送關注:發送 GET 請求到 `/api/stock-prices/`
|
||||
- 查看兩隻股票:發送 GET 請求到 `/api/stock-prices/`
|
||||
- 查看兩隻股票並關注它:發送 GET 請求到 `/api/stock-prices/`
|
||||
|
||||
# --hints--
|
||||
|
||||
You can provide your own project, not the example URL.
|
||||
提交自己的項目,而不是示例的 URL。
|
||||
|
||||
```js
|
||||
(getUserInput) => {
|
||||
@@ -47,7 +47,7 @@ You can provide your own project, not the example URL.
|
||||
};
|
||||
```
|
||||
|
||||
You should set the content security policies to only allow loading of scripts and CSS from your server.
|
||||
將內容安全策略設置爲僅允許從服務器加載腳本和 CSS。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -62,7 +62,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
You can send a `GET` request to `/api/stock-prices` with form data containing a NASDAQ stock ticker. Returned will be an object with the property `stockData`.
|
||||
你可以向 `/api/stock-prices` 發送一個 `GET` 請求,將納斯達克股票代碼賦值給 `stock` 查詢參數。 返回的對象將包含一個名爲 `stockData` 的屬性。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -74,7 +74,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
The `stockData` property includes the `stock` ticker as a string, the `price` as a number, and `likes` as a number.
|
||||
`stockData` 屬性包括字符串 `stock` 代碼、數字 `price`,以及數字 `likes`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -89,13 +89,13 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
You can also pass along a `like` field as `true` (boolean) to have your like added to the stock(s). Only 1 like per IP should be accepted.
|
||||
你也可以用作爲 `true`(布爾值)來傳遞 `like` 字段,讓你的偏好添加到股票中。 每個 IP 應該只接受 1 個贊。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
If you pass along 2 stocks, the returned value will be an array with information about both stocks. Instead of `likes`, it will display `rel_likes` (the difference between the likes on both stocks) for both `stockData` objects.
|
||||
如果你傳遞了兩隻股票,返回值將是一個包含這兩隻股票信息的數組。 它將會顯示對於兩個 `stockData` 對象的 `rel_likes`(兩隻股票所獲得的贊同數的區別),而不是 `likes`。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
@@ -110,7 +110,7 @@ async (getUserInput) => {
|
||||
};
|
||||
```
|
||||
|
||||
All 5 functional tests are complete and passing.
|
||||
所有 5 項功能測試都已完成並通過。
|
||||
|
||||
```js
|
||||
async (getUserInput) => {
|
||||
|
Reference in New Issue
Block a user