docker run --rm --volume "$PWD":/usr/src/objecthash-java --workdir /usr/src/objecthash-java openjdk:8 bash -c "./gradlew fatJar"
objecthash-java is a Java version of Ben Laurie's objecthash.
This will be used by openregister-java to provide a verifiable log of data. For more details see the following RFCs:
The set of types supported this objecthash implementation are:
- Integer
- Unicode string
- List
- Set
- Hash
- Timestamp
- Raw
Timestamp is an extension. It represents a datetime in UTC with seconds precision, and is encoded by taking the ISO8601 string representation and prefixing with the tag "t".
Raw is also an extension. It is equivalent to the string type but signifies that the value is a raw byte array rather than human readable text.
objecthash-java does not implement Boolean or Float types.
TODO
Hash a single value:
ObjectHash.stringToHexDigest("Hello world"); // bd75f78d2f7aa16b72d9fcdb822754a10310ef4cd5b6cca6aa48d98331e246ab
- Java 8