{"_id":"@blockworks-foundation/borsh","_rev":"5-41cac2bc5e814fbf780b14ef85868e36","name":"@blockworks-foundation/borsh","dist-tags":{"latest":"0.3.1"},"versions":{"0.3.1":{"name":"@blockworks-foundation/borsh","version":"0.3.1","description":"Binary Object Representation Serializer for Hashing","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc -p ./tsconfig.json","test":"jest test --runInBand","fuzz":"jsfuzz borsh-ts/test/fuzz/borsh-roundtrip.js borsh-ts/test/fuzz/corpus/","dev":"yarn build -w","pretest":"yarn build","lint":"eslint borsh-ts/**/*.ts","fix":"eslint borsh-ts/**/*.ts --fix"},"repository":{"type":"git","url":"git+https://github.com/nearprotocol/borsh.git"},"keywords":["serializer","binary","serializer","deserializer","consistency","determenistic"],"author":{"name":"Near Inc"},"license":"Apache-2.0","bugs":{"url":"https://github.com/nearprotocol/borsh/issues"},"homepage":"https://github.com/nearprotocol/borsh#readme","devDependencies":{"@types/babel__core":"^7.1.2","@types/babel__template":"^7.0.2","@types/node":"^12.7.3","@typescript-eslint/eslint-plugin":"^2.18.0","@typescript-eslint/parser":"^2.18.0","bs58":"^4.0.0","eslint":"^6.5.1","jest":"^26.0.1","js-sha256":"^0.9.0","jsfuzz":"^1.0.14","typescript":"^3.6.2"},"dependencies":{"@types/bn.js":"^4.11.5","bn.js":"^5.0.0","bs58":"^4.0.0","text-encoding-utf-8":"^1.0.2"},"gitHead":"05005c60a23f89ec00cf941922b88fccb1b6bbec","_id":"@blockworks-foundation/borsh@0.3.1","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-LUokXiPZAv4sCYKAZhZP8FcRQVtn5A1oK24iCEwtG3AfiyljSrghmGY7RXK+Jhw+bPoTI/RHYCt6ODQ/poJRrA==","shasum":"38906cf05ea533afe93d4e4cb7a0a22951231d7f","tarball":"https://registry.npmjs.org/@blockworks-foundation/borsh/-/borsh-0.3.1.tgz","fileCount":45,"unpackedSize":76054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLeCsvM2sRc0jgRFrGkfFp7yZwU56xieOOnzgnx4DquAIhANyELhtdUyflNHKgn8x93DfBbH2F2MGcjnD5nmSkYbvN"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd4C2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3sg//TMkk+RFzIEIA6YJ9DpfWTahNEMDugV1sAIflLrgBEfCWID7a\r\nQmxZF0pBMvxnQgM1q0vJ5wEoxSg3yoi7ZOVaDhMGUjgw4H3yhYEnYZKgsVe4\r\nDp3xq5n6mTV7gyUnl0+SyRWD/LkpTYW9EafVJ1bUCI20rf8GNGO21eIuoAGs\r\nzdmEl8LmzlbYLYYnCaKea7EGarTjmV+GS6iGsKxFlf8Q2vN1FgzeQ3k+a0LG\r\ntivJ281KuDKMXHNLjIX/v0Zij1XSI8fKxXvz5DUXOVbHKsomOiGHsi8aO5V9\r\nvE3YHg6zya2MXiiQnZfME4TvSZ70IpgSRQZfXhdSHfNXeFBAoVGyXznZqrSS\r\nfsth7D21ftIpoWpeROyZIAdaxj7MDovCMjplx2ax/akArs6LrOntg4bsUr/e\r\nQ9jrx5Mq9CRzasFTptLOXsmMxUt8XxanuzPtp+qfKQEvEJP96wE4BZRvumO6\r\ntGP4EgN31dwgWgX00I1l3kZ1JiPR5WAchWZfdnREFP0HrxRbx51dDs06nK9g\r\nCi4+YF+nQ0m+nuZv8tEvnpj/QrW/ikgfMzBv3g/mspDqSE9M3bmKlyfkKWRI\r\nCSGdu4lvRQhMUOUF+l3W8nWH2fY7gZLEX9AkEzcbC+IFPMNz7hKQKYhOw1DJ\r\nc3FtypRXeyR/ePoXDsPqNbdLmbsPzcQctgE=\r\n=Dtsh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"maximilianschneider","email":"mail@maximilianschneider.net"},"directories":{},"maintainers":[{"name":"mes_","email":"a.brzezinski94@gmail.com"},{"name":"ckamm","email":"mail@ckamm.de"},{"name":"microwavedcola","email":"microwavedcola@gmail.com"},{"name":"riordanp","email":"riordan@panayid.es"},{"name":"maximilianschneider","email":"mail@maximilianschneider.net"},{"name":"tjshipe","email":"tjshipe@gmail.com"},{"name":"dafydd.durairaj","email":"dafydd@oneboxtrading.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/borsh_0.3.1_1668776118638_0.6554032959569696"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-18T12:55:18.567Z","0.3.1":"2022-11-18T12:55:18.787Z","modified":"2023-08-18T00:48:59.346Z"},"maintainers":[{"email":"lou@mango.markets","name":"loukamades"},{"email":"a.brzezinski94@gmail.com","name":"mes_"},{"email":"mail@ckamm.de","name":"ckamm"},{"email":"microwavedcola@gmail.com","name":"microwavedcola"},{"email":"riordan@panayid.es","name":"riordanp"},{"email":"mail@maximilianschneider.net","name":"maximilianschneider"},{"email":"tjshipe@gmail.com","name":"tjshipe"},{"email":"dafydd@oneboxtrading.com","name":"dafydd.durairaj"}],"description":"Binary Object Representation Serializer for Hashing","homepage":"https://github.com/nearprotocol/borsh#readme","keywords":["serializer","binary","serializer","deserializer","consistency","determenistic"],"repository":{"type":"git","url":"git+https://github.com/nearprotocol/borsh.git"},"author":{"name":"Near Inc"},"bugs":{"url":"https://github.com/nearprotocol/borsh/issues"},"license":"Apache-2.0","readme":"# Borsh JS\n\n[![Project license](https://img.shields.io/badge/license-Apache2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Project license](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Discord](https://img.shields.io/discord/490367152054992913?label=discord)](https://discord.gg/Vyp7ETM)\n[![Travis status](https://travis-ci.com/near/borsh.svg?branch=master)](https://travis-ci.com/near/borsh-js)\n[![NPM version](https://img.shields.io/npm/v/borsh.svg?style=flat-square)](https://npmjs.com/borsh)\n[![Size on NPM](https://img.shields.io/bundlephobia/minzip/borsh.svg?style=flat-square)](https://npmjs.com/borsh)\n\n**Borsh JS** is an implementation of the [Borsh] binary serialization format for\nJavaScript and TypeScript projects.\n\nBorsh stands for _Binary Object Representation Serializer for Hashing_. It is meant to be used in security-critical projects as it prioritizes consistency,\nsafety, speed, and comes with a strict specification.\n\n## Examples\n### Serializing an object\n```javascript\nconst value = new Test({ x: 255, y: 20, z: '123', q: [1, 2, 3] });\nconst schema = new Map([[Test, { kind: 'struct', fields: [['x', 'u8'], ['y', 'u64'], ['z', 'string'], ['q', [3]]] }]]);\nconst buffer = borsh.serialize(schema, value);\n```\n\n### Deserializing an object\n```javascript\nconst newValue = borsh.deserialize(schema, Test, buffer);\n```\n\n## Type Mappings\n\n| Borsh                 | TypeScript     |\n|-----------------------|----------------|\n| `u8` integer          | `number`       |\n| `u16` integer         | `number`       |\n| `u32` integer         | `number`       |\n| `u64` integer         | `BN`           |\n| `u128` integer        | `BN`           |\n| `f32` float           | N/A            |\n| `f64` float           | N/A            |\n| fixed-size byte array | `Uint8Array`   |\n| UTF-8 string          | `string`       |\n| option                | `null` or type |\n| map                   | N/A            |\n| set                   | N/A            |\n| structs               | `any`          |\n\n## Contributing\n\nInstall dependencies:\n```bash\nyarn install\n```\n\nContinuesly build with:\n```bash\nyarn dev\n```\n\nRun tests:\n```bash\nyarn test\n```\n\nRun linter\n```bash\nyarn lint\n```\n## Publish\n\nPrepare `dist` version by running:\n```bash\nyarn build\n```\n\nWhen publishing to npm use [np](https://github.com/sindresorhus/np).\n\n# License\nThis repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0).\nSee [LICENSE-MIT](LICENSE-MIT.txt) and [LICENSE-APACHE](LICENSE-APACHE) for details.\n\n[Borsh]:          https://borsh.io","readmeFilename":"README.md"}