Skip to content

Pure Kotlin UByte constants for the standard ASCII character set.

License

Notifications You must be signed in to change notification settings

k-libs/k-ubyte-ascii

Repository files navigation

K-Libs Multi-Platform Library Repo Template

k ubyte ascii docs dokka ff69b4 ubyte ascii

The ASCII standard character set as UByte constants.

Helpful for implementing low level parsers.

Import

  implementation("io.k-libs:ubyte-ascii:1.1.0")

Examples

Byte Checks
internal fun UByte.isWhitespace() = this == ASCII_SPACE

internal fun UByte.isTab() = this == ASCII_TAB

internal fun UByte.isHexDigit() = when(this) {
  in ASCII_DIGIT_0 .. ASCII_DIGIT_9 -> true
  in ASCII_UPPER_A .. ASCII_UPPER_F -> true
  in ASCII_LOWER_A .. ASCII_LOWER_F -> true
  else                              -> false
}

Version History

Version Documentation Notes

v1.1.0

Dokka

Add common aliases and expanded alternatives for control characters.

v1.0.0

Dokka

Initial Release

About

Pure Kotlin UByte constants for the standard ASCII character set.

Resources

License

Stars

Watchers

Forks

Languages