# Quiz 22

How is padding added to the message block in SHA-256?

**Type all answers and select the correct one**

* [x] By adding a 1 bit followed by zeros until the length is 64 bits short of a multiple of 512
* [ ] By adding only zeros
* [ ] By appending the message length directly
* [ ] By adding random bits<br>

**Note to Learners**

"To do this, we first add a 1 bit to denote where the padding bits start within the block, then we add zeros until we reach a bit length that's 64 bits short of a multiple of 512 bits."

&#x20;

To learn more about it, you can follow the course [Walkthrough Implementation of SHA-256 in Golang](https://bsvblockchain.360learning.com/course/play/68bac07ee4056be2a5dd1108)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-primitives-hash-functions/quiz-bitcoin-hash-functions/quiz-22.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
