Skip to content

opotonniee/idc-tx-digest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IdCloud Transaction Data Digest

Javascript library to compute the digest of a JSON transaction data using the IdCloud transaction digest algorithm.

Usage:

let txDigest = new IdcTxDigest();
txDigest.digest(`[
  { "amount" : "123" },
  { "beneficiary" : "John Smith" }
]`)
.then(res => {
  console.log("Digest is " + txDigest.toHex(res.digest))
})
.catch(err => {
  console.log("Error: " + err)
})

To allow processing of both the legacy and the new JSON format a second attribute must be set to true:

txDigest.digest(`{
  "amount" : "123",
  "beneficiary" : "John Smith"
}`, true)

You can test it here

Releases

No releases published

Packages

No packages published