summaryrefslogtreecommitdiff
path: root/contrib/hexToCrock.mjs
blob: e5c10b341ab439915ad2d49d132f6e007f132be2 (plain)
1
2
3
4
5
6
7
8
9
import { encodeCrock } from './wallet-core/packages/taler-util/lib/index.js'

const hex = process.argv[2];

const typedArray = new Uint8Array(hex.match(/[\da-f]{2}/gi).map(function (h) {
  return parseInt(h, 16)
}))

console.log(encodeCrock(typedArray));