# What separator should I use (SHA256) [closed]

I'm saving a log file in with each line corresponds to a log entry.

For integrity reason I'm adding at the end of each line a SHA256 hash of the previous line.

What is the best separator to use string to separate the log entry from the hash?

• Note that a hash such as SHA-256 only protects against non-malicious changes. To protect it against malicious changes you'd need a MAC or signature. – Maarten Bodewes Sep 20 '16 at 11:09

So use a space (_), or a | or even _|_ for some nice whitespace to keep things readable. You need to look for the separator or hash string starting at the end though, e.g. using a regular expression or some lastIndexOf function. Make sure you raise a warning or error if the hash value has not been set, it could have been stripped off.