{"nyc":{"all":true,"cache":false,"exclude":["**/*.d.ts"],"include":["src/**/*.ts"],"require":["ts-node/register/transpile-only","source-map-support/register"],"reporter":["text","lcov"],"extension":[".ts"]},"bugs":{"url":"https://github.com/blockstack/c32check/issues"},"dist":{"shasum":"0e437dbb541927c7969e95cea22fa0e9bb7aa559","tarball":"https://registry.npmjs.org/c32check/-/c32check-1.0.0.tgz","fileCount":21,"integrity":"sha512-tC18ZhLmNYBlRWAU7KQzbyPujOg+8obrv0Kw/zkIyziW+bzYrpLytHGP4kUuMw2kJ0rnwN8PDn1428X6Khd6oQ==","signatures":[{"sig":"MEUCIQDsgSc19v+X+KBmjSt4+vWWLHOU1zl2eQZ7VFt9YZP3uAIgBMtH7NjkEtK/SFYEbEa3bkAxNAGbfbCLIPp0GaxDHI0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18239657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd6tE0CRA9TVsSAnZWagAAhTQP/2DY+NFQvHVguEjukIXG\nTTmVzFolWdvuCCuzC/x9HJ/epM0JxnCDf0shq/Q9oG2G/+f/VgUSVSLIC5sH\ngRYCu4Zn9/oYTGWE6FeUcDMncI+rnC/HNeQo6qKTtZhlSNZj4q2qmOLWJ0Fs\niQn1U7J1Xn7ZfMSuKbRYnL8O5YnKuaBDq+17xHaRpHZW7KnouUsYY8p/RQbh\n6vKSKvfu8UaquCe9YznL/vmkCUqsdN3rT8bBvhYH21lnM42EY94Ql+3QuiC9\nMoJ0QSYTkZ3m1CiKTqBWpswoZ0ivJtBe7x7xEWeHY7p1ZYt0OxK9XHwUy3Ah\nAzvXzGDkXeZZlGwzFA+TZzu3ypR0h3c+HiDrhzyM2H4wUXA4RUcjR2yyS/mk\nd/nxvg8RTbkt8Xc7b3Pa7JrCpq6v2/CuqA79K/PgmZTU2FSkmaVeJDs+EJR+\nnM843fA5vS/vhc3V1C95rg9wzITKOlF/al9xJg9NTGDf5cb/DskdWLee9gBx\nMGK4dJFA6LlGtXvP4VuRz7vf3p+lENz51JQ8FH9j65BW5w5z7djIIM8XyPED\nP/5CmdEA42rCw1bF4vaO3FX1WfqPiQmoBh5ouR7RJIMKRf5Uvwt5Ut95SYJS\naopNEbTgBSHrTFy8pcPM8KHMgxEuPjWSw+A41P29VxoaVswBu0ShuuWYw0Im\nhCeJ\r\n=vKjf\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index","name":"c32check","unpkg":"dist/c32check.js","author":{"url":"https://blockstack.com","name":"Jude Nelson","email":"jude@blockstack.com"},"readme":"# c32check\n\n[Crockford base-32](https://en.wikipedia.org/wiki/Base32#Crockford's_Base32) encoding library\nwith 4-byte checksum.\n\nThis library is meant for generating and decoding Stacks addresses on the\nBlockstack blockchain.\n\n## How it works\n\nEach c32check string encodes a 1-byte version and a 4-byte checksum.  When\ndecoded as a hex string, the wire format looks like this:\n\n```\n0      1                             n+1             n+5\n|------|-----------------------------|---------------|\nversion     n-byte hex payload          4-byte hash\n```\n\nIf `version` is the version byte (a 1-byte `number`) and `payload` is the raw \nbytes (e.g. as a `string`), then the `checksum` is calculated as follows:\n\n```\nchecksum = sha256(sha256(version + payload)).substring(0,4)\n```\n\nIn other words, the checksum is the first four bytes of the\ndouble-sha256 of the bytestring concatenation of the `version` and `payload`.\nThis is similar to base58check encoding, for example.\n\n## c32 Addresses\n\nSpecific to Blockstack, the Stacks blockchain uses c32-encoded public key\nhashes as addresses.  Specifically, a **c32check address** is a c32check-encoded\nripemd160 hash.\n\n# Examples\n\n```\n> c32 = require('c32check')\n{ c32encode: [Function: c32encode],\n  c32decode: [Function: c32decode],\n  c32checkEncode: [Function: c32checkEncode],\n  c32checkDecode: [Function: c32checkDecode],\n  c32address: [Function: c32address],\n  c32addressDecode: [Function: c32addressDecode],\n  versions: \n   { mainnet: { p2pkh: 22, p2sh: 20 },\n     testnet: { p2pkh: 26, p2sh: 21 } },\n  c32ToB58: [Function: c32ToB58],\n  b58ToC32: [Function: b58ToC32] }\n```\n\n## c32encode, c32decode\n\n```\n> c32check.c32encode(Buffer.from('hello world').toString('hex'))\n'38CNP6RVS0EXQQ4V34'\n> c32check.c32decode('38CNP6RVS0EXQQ4V34')\n'68656c6c6f20776f726c64'\n> Buffer.from('68656c6c6f20776f726c64', 'hex').toString()\n'hello world'\n```\n\n## c32checkEncode, c32checkDecode\n\n```\n> version = 12\n12\n> c32check.c32checkEncode(version, Buffer.from('hello world').toString('hex'))\n'CD1JPRV3F41VPYWKCCGRMASC8'\n> c32check.c32checkDecode('CD1JPRV3F41VPYWKCCGRMASC8')\n[ 12, '68656c6c6f20776f726c64' ] \n> Buffer.from('68656c6c6f20776f726c64', 'hex').toString()\n'hello world'\n```\n\n## c32address, c32addressDecode\n\n**NOTE**: these methods only work on ripemd160 hashes\n\n```\n> hash160 = 'a46ff88886c2ef9762d970b4d2c63678835bd39d'\n'a46ff88886c2ef9762d970b4d2c63678835bd39d'\n> version = c32check.versions.mainnet.p2pkh\n22\n> c32check.c32address(version, hash160)\n'SP2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKNRV9EJ7'\n> c32check.c32addressDecode('SP2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKNRV9EJ7')\n[ 22, 'a46ff88886c2ef9762d970b4d2c63678835bd39d' ]\n```\n\n## c32ToB58, b58ToC32\n\n**NOTE**: Common address versions are converted between c32check\nand base58check seamlessly, in order to accomodate Stacks addresses.\n\n```\n> b58addr = '16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg'\n'16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg'\n> c32check.b58ToC32(b58addr)\n'SPWNYDJ3STG7XH7ERWXMV6MQ7Q6EATWVY5Q1QMP8'\n> c32check.c32ToB58('SPWNYDJ3STG7XH7ERWXMV6MQ7Q6EATWVY5Q1QMP8')\n'16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg'\n```\n```\n> b58addr = '3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r'\n'3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r'\n> c32check.b58ToC32(b58addr)\n'SM1Y6EXF21RZ9739DFTEQKB1H044BMM0XVCM4A4NY'\n> c32check.c32ToB58('SM1Y6EXF21RZ9739DFTEQKB1H044BMM0XVCM4A4NY')\n3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r'\n```\n","engines":{"node":">=8"},"gitHead":"3b22ce6f81b621de2e2098d2d0a4dea02c1bf013","license":"MIT","scripts":{"lint":"eslint --ext=.ts -f=codeframe ./src ./tests","test":"nyc node ./tests/unitTests/src/index.ts","build":"npm run lint && npm run test && npm run webpack && npm run compile","compile":"rimraf lib && tsc","webpack":"rimraf lib dist && webpack --mode=production","prettier":"prettier --write ./src/**/*.ts","prepublish":"npm run build","codecovUpload":"codecov","data-set-test":"npm run lint && cross-env BIG_DATA_TESTS=1 nyc node ./tests/unitTests/src/index.ts"},"_npmUser":{"name":"zone117x","email":"zone117x@gmail.com"},"homepage":"https://blockstack.org","jsdelivr":"dist/c32check.js","keywords":["blockchain","id","auth","authentication","bitcoin","blockchain auth","blockchain authentication","blockchainid","blockchain id","bitcoin auth","bitcoin authentication","bitcoin login","blockchain login","authorization","login","signin","sso","crypto","cryptography","token","blockstack","blockstack auth","profile","identity","ethereum"],"prettier":"@blockstack/prettier-config","repository":{"url":"git+https://github.com/blockstack/c32check.git","type":"git"},"_npmVersion":"6.12.0","description":"Crockford base-32 checksum encoding","directories":{},"maintainers":[{"name":"ablankstein","email":"aaron@blockstack.com"},{"name":"aulneau","email":"hello@ineffable.co"},{"name":"hstove","email":"hstove@gmail.com"},{"name":"jcnelson","email":"jude@blockstack.com"},{"name":"kyranjamie","email":"kyran@blockstack.com"},{"name":"zone117x","email":"zone117x@gmail.com"}],"_nodeVersion":"12.13.0","contributors":[{"name":"Jude Nelson","email":"jude@blockstack.com"},{"name":"Aaron Blankstein","email":"aaron@blockstack.com"},{"name":"Matthew Little","email":"matt@blockstack.com"}],"dependencies":{"ripemd160":"^2.0.1","base58check":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.1.1","tape":"^4.11.0","eslint":"^6.7.2","rimraf":"^3.0.0","codecov":"^3.6.1","ts-node":"^8.5.4","webpack":"^4.41.2","prettier":"^1.19.1","cross-env":"^6.0.3","ts-loader":"^6.2.1","typescript":"^3.7.3","@babel/core":"^7.7.4","@types/node":"^12.12.14","webpack-cli":"^3.3.10","babel-loader":"^8.0.6","tape-promise":"^4.0.0","@babel/preset-env":"^7.7.4","source-map-support":"^0.5.16","@typescript-eslint/parser":"^2.10.0","@blockstack/prettier-config":"0.0.4","@typescript-eslint/eslint-plugin":"^2.10.0"},"_npmOperationalInternal":{"tmp":"tmp/c32check_1.0.0_1575670068032_0.14529100146090435","host":"s3://npm-registry-packages"},"_id":"c32check@1.0.0","version":"1.0.0"}