Submit documents

Submits a document on behalf of you or a customer if you operate a platform on zerohash.

For document uploads to a participant, you must include the header 'X-SCX-FILE-HASH' and pass the value of your hashed document.

File Hashing

Step 1

Read File Content and Base64 EncodeThe first step is to read the entire file as binary data (bytes) and immediately convert this raw data into a Base64-encoded string.

  • Action: Open the target file in binary read mode ("rb") and read its entire content into memory.
  • Transformation: Take the raw binary data and apply a Base64 encoding function to it. This produces a string composed of standard ASCII characters.
  • Purpose: This Base64 string is the unique intermediate representation that will be used as the input for the cryptographic hash function.

Step 2

Hash the Base64 String (SHA-256)Next, the intermediate Base64 string is used as the input for the SHA-256 algorithm.

  • Pre-Hashing Prep: The Base64 string must be converted back into bytes using a standard character encoding (e.g., UTF-8) before being fed into the SHA-256 function.
  • Hashing: The SHA-256 algorithm processes these input bytes to generate a fixed-size 32-byte hash value, also known as the digest.

Step 3

Base64 Encode the Final DigestThe final step is to take the raw 32-byte digest generated in Step 2 and convert it into a string format that is easily stored and shared.

  • Action: Apply a second Base64 encoding operation, but this time to the raw 32-byte SHA-256 digest (not the original file content).
  • Result: This yields the final Base64-encoded hash string, which is the result of your specific three-step hashing process.
Language
Credentials
Click Try It! to start a request and see the response here!