Skip to content

Commit

Permalink
Export endian functions
Browse files Browse the repository at this point in the history
  • Loading branch information
joon9823 committed Nov 15, 2024
1 parent 285dccb commit 86d0d19
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@initia/initia.js",
"version": "0.2.22",
"version": "0.2.23",
"description": "The JavaScript SDK for Initia",
"license": "Apache-2.0",
"author": "Initia Foundation",
Expand Down
4 changes: 2 additions & 2 deletions src/util/bcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const bcs = {
...initiaBcs,
}

function toLittleEndian(bigint: bigint): Uint8Array {
export function toLittleEndian(bigint: bigint): Uint8Array {
const result = []
while (bigint > 0) {
result.push(Number(bigint % BigInt(256)))
Expand All @@ -152,7 +152,7 @@ function toLittleEndian(bigint: bigint): Uint8Array {
return new Uint8Array(result)
}

function fromLittleEndian(bytes: number[]): bigint {
export function fromLittleEndian(bytes: number[]): bigint {
let result = 0n
while (bytes.length > 0) {
result = result * 256n + BigInt(bytes.pop() as number)
Expand Down

0 comments on commit 86d0d19

Please sign in to comment.