title: Generating the same SHA1 UUID in golang and Javascript
body: <p>I have what I thought was a pretty simply question. I'm using this code to generate a SHA1 uuid in Golang:</p>
  
  <pre><code>namespace := uuid.Parse("b9cfdb9d-f741-4e1f-89ae-fac6b2a5d740")
  sha := uuid.NewSHA1(namespace, []byte("something"))
  fmt.Println(sha.String())
  </code></pre>
  
  <p>Now I want to generate the same UUID in javascript, and I thought it would be as easy as something like this:</p>
  
  <pre><code>var hash = CryptoJS.SHA1("b9cfdb9d-f741-4e1f-89ae-fac6b2a5d740" + "something")
  // chomp the hash into a UUID string
  </code></pre>
  
  <p>However, I'm running into serious issues. It seems that the <code>uuid.Parse</code> function in Golang is running <a href="https://code.google.com/p/go-uuid/source/browse/uuid/util.go#39" rel="noreferrer">this parsing function</a> that converts the namespace to a 16-byte array, so even though I use the same SHA1 algorithm in Javascript, I'm not getting the same output.</p>
  
  <p>I'v been messing around with doing the same in JS, but I'm stumped. </p>
  
  <p>Any smart crypto people in here that can help me?</p>