{"id":25388750,"url":"https://github.com/artembotnev/low-level-extensions","last_synced_at":"2026-05-20T05:32:27.946Z","repository":{"id":182299365,"uuid":"265932143","full_name":"ArtemBotnev/low-level-extensions","owner":"ArtemBotnev","description":"Simple Kotlin, Java library for easy work with numeric types converting to bytes array and vice versa.","archived":false,"fork":false,"pushed_at":"2020-06-29T15:38:50.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T13:46:41.574Z","etag":null,"topics":["byte-array","java","kotlin","low-level"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArtemBotnev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-05-21T19:16:46.000Z","updated_at":"2020-06-29T15:38:52.000Z","dependencies_parsed_at":"2023-07-19T13:44:12.504Z","dependency_job_id":null,"html_url":"https://github.com/ArtemBotnev/low-level-extensions","commit_stats":null,"previous_names":["artembotnev/low-level-extensions"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2Flow-level-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2Flow-level-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2Flow-level-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArtemBotnev%2Flow-level-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArtemBotnev","download_url":"https://codeload.github.com/ArtemBotnev/low-level-extensions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248113958,"owners_count":21049943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["byte-array","java","kotlin","low-level"],"created_at":"2025-02-15T13:38:34.044Z","updated_at":"2026-05-20T05:32:22.923Z","avatar_url":"https://github.com/ArtemBotnev.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://jitpack.io/v/ArtemBotnev/low-level-extensions.svg)](https://jitpack.io/#ArtemBotnev/low-level-extensions)\n\n## Low level extensions\n#### Simple Kotlin, Java library for easy work with numeric types converting to bytes array and vice versa.\n#### Support for all Number types.\n#### Kotlin example of usage:\nConvert integer to byte array\n```kotlin\nval source = -343\nval bytes = source.toByteArray()\n```\nConvert byte array to short\n```kotlin\nval bytes = byteArrayOf(-18, 41)\nval result: Short = bytes.toShort()\n```\n\nConvert byte array to hex string\n```kotlin\nval bytes = byteArrayOf(-12, 32, 12, 0, 32, -73, 94, 120, -54, 34, 93, -107)\nval hexString = value.toHexString()\n```\nresult: f4200c0020b75e78ca225d95  \nYou can pass ```true``` to function ```toHexString(true)``` for upper case letters.\n\nConvert hex string to byte array\n```kotlin\nval hexString = \"a0f33402\"\nval bytes = hexString.fromHexStringToByteArray()\n```\n\n#### Java example of usage:\nConvert integer to byte array\n```java\nint source = -343;\nbyte[] bytes = LowLevelExtensionsKt.toByteArray(source);\n```\nConvert byte array to long\n```java\nbyte[] bytes = { 34, -2, 13, 34, 23, -3, 43, 102 };\nlong result = LowLevelExtensionsKt.toLong(bytes);\n```\nConvert byte array to hex string\n```java\nbyte[] byteArray = { -12, 32, 12, 0, 32, -73, 94, 120, -54, 34, 93, -107 };\nString hexString = LowLevelExtensionsKt.toHexString(byteArray, false);\n```\nresult: f4200c0020b75e78ca225d95  \nYou can pass ```true``` to method ```toHexString(byteArray, true)``` for upper case letters.\n\nConvert hex string to byte array\n```java\nString hexString  = \"a0f33402\";\nbyte[] byteArray = LowLevelExtensionsKt.fromHexStringToByteArray(hexString);\n```\n\n#### To use this, add dependensies to your project:\nJitpack repository to your root build.gradle at the end of repositories\n```groovy\nallprojects {\n repositories {\n  ...\n  maven { url 'https://jitpack.io' }\n  }\n }\n```\nand to module level build.gradle\n```groovy\ndependencies {\n implementation 'com.github.ArtemBotnev:low-level-extensions:1.1.1'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartembotnev%2Flow-level-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartembotnev%2Flow-level-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartembotnev%2Flow-level-extensions/lists"}