Skip to content

Commit

Permalink
docs: s2
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Jul 18, 2024
1 parent f3ed6b0 commit 5b190e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion s2/cellid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ export const toToken = (ci: cellid): string => {

/**
* Returns a cell id given a hex-encoded string.
* @category Constructors
*/
export const fromToken = (t: string): cellid => {
if (t.length > 16) return 0n

let ci = BigInt('0x' + t)
if (t.length < 16) ci = ci << BigInt(4 * (16 - t.length))
return ci
Expand Down

0 comments on commit 5b190e8

Please sign in to comment.