Skip to content

Commit

Permalink
Add main index.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
Shigoto-dev19 committed May 6, 2024
1 parent ad894ab commit a7f4a0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/base64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import { Field, Bool, Bytes, assert } from 'o1js';

export { base64Decode };

/**
* Decodes a base64-encoded input bytes to the corresponding decoded field array.
*
* @param inputBytes The base64-encoded input bytes.
* @param byteLength The length of the output decoded bytes.
* @returns The decoded bytes array with the expected length specified by byteLength.
*/
function base64Decode(inputBytes: Bytes, byteLength: number) {
const encodedB64Bytes = inputBytes.toFields();

Expand Down Expand Up @@ -101,4 +108,4 @@ function base64Lookup(input: Field): Field {
);

return sum_slash;
}
}
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { base64Decode } from './base64.js';
export { calculateB64DecodedBytesLength } from './utils.js';

0 comments on commit a7f4a0a

Please sign in to comment.