Skip to content

Commit

Permalink
renaming to o1js-pack
Browse files Browse the repository at this point in the history
  • Loading branch information
45930 committed Sep 14, 2023
1 parent 6e01e96 commit c45c9a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# SnarkyPack
# O1JS Pack

Make the most of your ZKApp state!

## What is it

SnarkyPack is a library for [snarkyJS](https://github.com/o1-labs/snarkyjs/) that allows a zkapp developer to pack extra data into a single Field.
O1JS Pack is a library for [O1JS](https://github.com/o1-labs/o1js/) that allows a zkapp developer to pack extra data into a single Field.

### Usage in a ZKApp

Expand All @@ -13,11 +13,11 @@ import {
PackedBoolFactory,
PackedStringFactory,
PackedUInt32Factory,
} from 'snarkyjs-pack';
} from 'o1js-pack';
const MyPackedBools = PackedBoolFactory(254); // Max of 254 Bools
const MyPackedString = PackedCharacterFactory(120); // Max of 120 Characters
const MyPackedUInts = PackedUInt32Factory(7); // Max of 7 UInt32s
const MyPackedBools = PackedBoolFactory(); // Max of 254 Bools
const MyPackedString = PackedStringFactory(); // Max of 120 Characters
const MyPackedUInts = PackedUInt32Factory(); // Max of 7 UInt32s
const sevenUints = [1, 2, 3, 4, 5, 6, 7].map(x => UInt32.from(x));
const myPackedUInts = new MyPackedUInts(MyPackedUInts.pack(sevenUints), sevenUints);
Expand All @@ -38,7 +38,7 @@ npm run build
## How to run tests

```sh
npm run test
npm run test src # non-proof tests
npm run testw # watch mode
```

Expand All @@ -52,6 +52,8 @@ npm run coverage

Thanks to @mario_zito for seeding the idea for this library on discord ([Thread 1](https://discord.com/channels/484437221055922177/1128509274465779822), [Thread 2](https://discord.com/channels/484437221055922177/1128501705173106698)), and to @gregor for sounding out the early implementation.

Thanks to @iam-dev for early adoption!

## License

[Apache-2.0](LICENSE)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snarkyjs-pack",
"version": "0.3.0",
"name": "o1js-pack",
"version": "0.3.1",
"description": "",
"author": "45930",
"license": "Apache-2.0",
Expand Down

0 comments on commit c45c9a0

Please sign in to comment.