Skip to content

Latest commit

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pBit

Bitwise library that works without overflow.

Functions

  • lib.IPAddressFromInt( number x )
  • lib.IPAddressToInt( string ip )
  • lib.ColorToInt( Color color )
  • lib.ColorFromInt( number x )
  • lib.Vec4FromInt( number x )
  • lib.Vec4ToInt( number a, number b, number c, number d )
  • lib.bisset( number x, number bitn, vararg ... )
  • lib.bunset( number x, number bitn )
  • lib.band( number a, number b )
  • lib.bnot( number x, number bits )
  • lib.bor( number a, number b )
  • lib.bset( number x, number bitn )
  • lib.bxor( number a, number b )
  • lib.lshift( number x, number bits )
  • lib.rshift( number x, number bits )
  • lib.tobin( number x, number bits )
  • lib.frombin( number x )

Example (ip4 to int)

localpbit=install( "packages/pbit" )
localst=SysTime()
localbits=pbit.IPAddressToInt( "192.168.0.1" )
print( "bits", bits, string.format( "%f", SysTime() -st ) )
st=SysTime()
localip=pbit.IPAddressFromInt( bits )
print( "ip", ip, string.format( "%f", SysTime() -st ) )

About

Bitwise library that works without overflow.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages