title: Java like function getLeastSignificantBits() & getMostSignificantBits in Python?
body: <p>Can someone please help me out in forming an easy function to extract the leastSignificant &amp; mostSignificant bits in Python?</p>
  
  <p>Ex code in Java:</p>
  
  <pre><code>UUID u = UUID.fromString('a316b044-0157-1000-efe6-40fc5d2f0036');
  long leastSignificantBits = u.getLeastSignificantBits();
  
  private UUID(byte[] data) {
      long msb = 0;
      long lsb = 0;
      assert data.length == 16 : "data must be 16 bytes in length";
      for (int i=0; i&lt;8; i++)
          msb = (msb &lt;&lt; 8) | (data[i] &amp; 0xff);
      for (int i=8; i&lt;16; i++)
          lsb = (lsb &lt;&lt; 8) | (data[i] &amp; 0xff);
      this.mostSigBits = msb;
      this.leastSigBits = lsb;
  }
  </code></pre>
  
  <p>--> Output value: -1160168401362026442</p>