项目作者: kotlin-graphics

项目描述 :
unsigned support for Kotlin via boxed types and unsigned operators
高级语言: Kotlin
项目地址: git://github.com/kotlin-graphics/kotlin-unsigned.git
创建时间: 2016-10-21T09:51:40Z
项目社区:https://github.com/kotlin-graphics/kotlin-unsigned

开源协议:MIT License

下载


kotlin-unsigned

Build Status
license
Size
Github All Releases

Unsigned operators and boxed types (U8, U16, U32 and U64) for unsigned support.

To have a quick idea what this library offers, take a look at the tests)

Differences with kotlin stdlib:

  • this project uses classes instead inline classes. To address this in critical scenarios where allocations may have a sensitive impact, primitive variable holding the unsigned
    type value is a var, so you can re-use the same instance over and over again
  • unsigned types extend Number abstract class
  • automatic conversions
  • it is possible to get a string representation with a specific format by calling the corresponding toString(format: String) method, eg: ubyte.format("%08x")
  • all the unsigned types implement all the function, including shl and shr for Ubyte and Ushort
  • there is no automatic padding to integer for unsigned bytes and shorts, so if you add an Ushort to another Ushort you get an Ushort (and not an Uint)

Install:

mary

  1. repositories {
  2. maven("https://raw.githubusercontent.com/kotlin-graphics/mary/master")
  3. // or with magik plugin
  4. //github("kotlin-graphics/mary")
  5. }
  6. dependencies {
  7. implementation("kotlin.graphics:unsigned:3.3.32")
  8. }

maven central

  1. dependencies {
  2. implementation("io.github.kotlin-graphics:kotlin-unsigned:3.3.32")
  3. }

You can find more info by mary

Contributions:

Don’t hesitate to contribute to the project by submitting issues or pull requests for bugs and features. Any feedback is welcome at elect86@gmail.com"">elect86@gmail.com.

Credits:


Deploys by Netlify