title: shell-out value to md5 (crypto) function
body: <p>I'm looking for a solution where I'm building out a JSON record and need to generate some text in JQ but pipe this text to an MD5 sum function and use it as a value for a key.</p>
  
  <pre><code>echo '{"first": "John", "last": "Big"}' | jq '. | { id: (.first + .last) | md5 }'
  </code></pre>
  
  <p>From looking at the manual and the GH issues I can't figure out how to do this since a function can't call out to a shell and there is not built in that provides a unique hash like functionality.</p>
  
  <h1>Edit</h1>
  
  <p>A better example what I'm looking for is this:</p>
  
  <pre><code>echo '{"first": "John", "last": "Big"}' | jq '. | {first, last, id: (.first + .last | md5) }'
  </code></pre>
  
  <p>to output:</p>
  
  <pre><code>{
    "first": "John",
    "last": "Big",
    "id": "cda5c2dd89a0ab28a598a6b22e5b88ce"
  }
  </code></pre>
  
  <h1>Edit2</h1>
  
  <p>and a little more context.  I'm creating <a href="http://ndjson.org/" rel="nofollow noreferrer">NDJson</a> files for use with esbulk.  I need to generate a unique key for each record. Initially, I thought piping out to the shell would be the simplest solution so I could either use sha1sum or some other hash function easily, but that is looking more challenging than I thought.</p>
  
  <p>A better example what I'm looking for is this:</p>
  
  <pre><code>echo '[{"first": "John", "last": "Big"}, {"first": "Justin", "last": "Frozen"}]' | jq -c '.[] | {first, last, id: (.first + .last | md5) }'
  </code></pre>
  
  <p>to output:</p>
  
  <pre><code>{"first":"John","last":"Big","id":"cda5c2dd89a0ab28a598a6b22e5b88ce"}
  {"first":"Justin","last":"Frozen","id":"af97f1bd8468e013c432208c32272668"}
  </code></pre>