title: How to have a custom timestamp and a hash sha256 and convert them into a string with Rust?
body: <p>I try to have a custom timestamp like this : YYYYMMDDHHMMSS<br />
  I use this to have my current time :</p>
  <pre><code>let timestamp = chrono::offset::Local::now();
  </code></pre>
  <p>to obtain somethings like :</p>
  <pre><code>2020-11-12T09:53:02.419182341+00:00
  </code></pre>
  <p>So how can I extract/convert this into the format I want, and after to convert it into a string?<br />
  Because I want to concatenate it with a hash.<br />
  I'm actually using this :</p>
  <pre><code>let auth = [timestamp, hash].concat();
  </code></pre>
  <p>And I have a other problem :
  how to encode my hash in sha256 and how to convert it into a string ?<br />
  Because I'm actually using :</p>
  <pre><code>  let mut hasher = Sha256::new();
    hasher.update(&quot;Hello world&quot;);
    let hash = hasher.finalize();
    println!(&quot;{:?}&quot;, hash);
  </code></pre>
  <p>And I obtain something like :</p>
  <pre><code>[100, 236, 136, 202, 0, 178, 104, 229, 186, 26, 53, 103, 138, 27, 83, 22, 210, 18, 244, 243, 102, 178, 71, 114, 50, 83, 74, 138, 236, 163, 127, 60]
  </code></pre>
  <p>Is it right?</p>
  <p>I've tried to use elastic_types, format, SystemTime, ...<br />
  But I can't reach my goal ...
  So your help would be welcome ! :)</p>