Skip to content

Commit 77791cb

Browse files
✨ feat(Integer): Add toJSON method.
1 parent 8df5ef4 commit 77791cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Integer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ export class Integer {
301301
return this.toString( 16 ) ;
302302
}
303303

304+
toJSON ( ) {
305+
return this.hex( ) ;
306+
}
307+
304308
digits ( base = DEFAULT_DISPLAY_BASE ) {
305309
return convert( this.base , base , this.limbs , 0 , this.limbs.length ).reverse( ) ;
306310
}

0 commit comments

Comments
 (0)