1
1
12rbah2020-04-17 18:14:45
go
12rbah, 2020-04-17 18:14:45

How to properly hash a large file?

I wanted to know how to correctly hash a file whose size exceeds the amount of RAM on the computer?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mercury13, 2020-04-17
@Mercury13

I didn't understand what "hash" means. If you get a hash sum, then all algorithms for calculating hash sums allow you to feed the file in small blocks. And the technique depends on the library of files and hash sums that you are currently using.

A
Alexander Pavlyuk, 2020-04-17
@pav5000

In Go, all packages for working with hashes (for example, crypto/sha256) can accept data in pieces.
An object with the io.Writer interface is simply created, and you can use io.Copy to redirect the data stream there, for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question