Class Crum

java.lang.Object
io.crums.model.HashUtc
io.crums.model.Crum
All Implemented Interfaces:
java.lang.Comparable<Crum>

public class Crum
extends HashUtc
implements java.lang.Comparable<Crum>
A timestamp, witness to a hash. Instances are immutable. This is a 2-tuple: a hash, and a UTC time.

Version 1 Note

This used to be a 3-tuple in version 0. The third field was a rather beefy 256-byte signature derived from the other 2 fields. The signature was meant to bridge the gap in time from when a hash is first witnessed to minutes later when it makes it into the tree. In truth, until the tree is published, the signature doesn't prove anything. It's only usecase is when a user wants to show a hash to another person before the tree is published and that other person already trusts crums.io. That's a tall story for a usecase, especially given the unneeded bloat and complexity it introduces, so the signature was altogether dropped. A signatured version can be layered on top, if the need/usecase arises.

See Also:
Notable Version 1 changes in Crum ordering
  • Constructor Details

    • Crum

      public Crum​(java.nio.ByteBuffer data)
    • Crum

      public Crum​(byte[] hash, long utc)
    • Crum

      public Crum​(java.nio.ByteBuffer hash, long utc)
  • Method Details

    • newSearchKey

      public static Crum newSearchKey​(byte[] hash)
    • newSearchKey

      public static Crum newSearchKey​(java.nio.ByteBuffer hash)
    • compareTo

      public int compareTo​(Crum o)
      Instances are ordered firstly by hash; secondly in time. Consistent with equals.
      Specified by:
      compareTo in interface java.lang.Comparable<Crum>