mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 20:05:50 +00:00
10 lines
391 B
JavaScript
10 lines
391 B
JavaScript
const cc = require('five-bells-condition')
|
|
const crypto = require('crypto')
|
|
|
|
const preimageData = crypto.randomBytes(32)
|
|
const myFulfillment = new cc.PreimageSha256()
|
|
myFulfillment.setPreimage(preimageData)
|
|
|
|
console.log('Condition:', myFulfillment.getConditionBinary().toString('hex').toUpperCase())
|
|
console.log('Fulfillment:', myFulfillment.serializeBinary().toString('hex').toUpperCase())
|